Dcoder icon

How many weeks @ Dcoder

By Lochard | As a newbie programmer | 23 Jul 2023


Problem: A town in Death Valley has a water tank that contains 10,000 gallons of water. If there is no rain, calculate the number of weeks the water will last for an input weekly water usage.

Input: Input contains positive integer n , which indicates weekly water usage

Output: Output will be number of weeks the water last for.

Constraints: 0<n<10000

Do not include the last week if the water remaining for that week is less than the weekly usage amount.

Sample Input: 1000

Sample Output: 

10

print(10000 // int(input()))

How do you rate this article?

2


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.