Skip to content

Instantly share code, notes, and snippets.

@AngelOnFira
Created April 6, 2019 14:48
Show Gist options
  • Select an option

  • Save AngelOnFira/9e19c2ef4a34fd5a0dce129082763ff1 to your computer and use it in GitHub Desktop.

Select an option

Save AngelOnFira/9e19c2ef4a34fd5a0dce129082763ff1 to your computer and use it in GitHub Desktop.
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