summaryrefslogtreecommitdiffstats
path: root/prog/aoc/23/6/1.py
blob: 1539b092f3a34c76c1741ec93a25777e824f9956 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python3
timestr = input().split(":")[1]
time = timestr.split(" ")
try:
	while True:
		time.remove("")
except:
	pass
time = [x for x in map(int, time)]
distancestr = input().split(":")[1]
distance = distancestr.split(" ")
try:
	while True:
		distance.remove("")
except:
	pass
distance = [x for x in map(int, distance)]
product = 1
for i in range(len(time)):
	ways = 0
	for j in range(time[i]):
		if (time[i]-j)*j > distance[i]:
			ways += 1
	product *= ways
print(product)
ways = 0
t = int(timestr.replace(" ", ""))
d = int(distancestr.replace(" ", ""))
for j in range(t):
	if (t-j)*j > d:
		ways += 1
print(ways)