Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help understanding this problem in python please help The provider will let Pero use up X megabytes to surf the internet per month.

I need help understanding this problem in python please help

image text in transcribed

The provider will let Pero use up X megabytes to surf the internet per month. Each megabyte that he doesn't spend in that month gets transferred to the next month and can still be spent. Of course, Pero can only spend the megabytes he actually has. If we know how much megabytes Pero has spent in each of the first N months of using the plan, determine how many megabytes Pero will have available in the N+1 month of using the plan. Input The first line of input contains the integer X(1X100). The second line of input contains the integer N(1N100). Each of the following N lines contains an integer Pi(0Pi10000), the number of megabytes spent in each of the first N months of using the plan. Numbers Pi will be such that Pero will never use more megabytes than he actually has. Output The first and only line of output must contain the required value from the task. Sample Input 1 Sample Output 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Ai And The Lottery Defying Odds With Intelligent Prediction

Authors: Gary Covella Ph D

1st Edition

B0CND1ZB98, 979-8223302568

More Books

Students also viewed these Databases questions