-
-
Save AngelOnFira/9e19c2ef4a34fd5a0dce129082763ff1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from collections import defaultdict | |
| t=sys.stdin.readline() | |
| l=[] | |
| while t: | |
| l.append(t.strip()) | |
| t = sys.stdin.readline() | |
| l = l[:-1] | |
| print(l) | |
| for climb in l: | |
| var = climb.split(" ") | |
| n = int(var[0]) | |
| u = int(var[1]) | |
| d = int(var[2]) | |
| total = 0 | |
| mins = 0 | |
| while total < n: | |
| mins += 1 | |
| total += u | |
| if total >= n: | |
| break | |
| mins += 1 | |
| total -= d | |
| print(mins) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment