import sys
from dataclasses import dataclass, field
from collections import namedtuple

DEBUG = True
debug_padding = 24

def debug_print(printname, *args):
    if DEBUG:
        print(f"{'DEBUG::'+printname:<{debug_padding}}", *args)




print("Parsing Input:")
print("")
print("===================================\n");

FILENAME = "/home/icaema/Public/advent-of-code/day-06/data/p01data.txt"
f = open(FILENAME, "r")

#for line in sys.stdin:
lines = f.readlines()
p_time = lines[0][5:].replace(' ', '').split()
p_farthest = lines[1][9:].replace(' ', '').split()
debug_print("input", f"ptime: {p_farthest}, p_farthest: {p_farthest}")

races = [(int(p_time[i]), int(p_farthest[i])) for i in range(len(p_time))]

debug_print("races", races)


result = 1

for race in races:
    winning_sleeptimes = len([slt for slt in range(race[0]) if (race[0]-slt)*slt > race[1]])
    print(winning_sleeptimes)
    result *= winning_sleeptimes

#for race in races:
#    #winning_sleeptimes = 0
#    less_count = 0
#    sleepTime = 1
#    while calc_distance(race.time, sleepTime) < race.distance:
#        less_count += 1
#        sleepTime += 1
#    result *= race.time - less_count*2 -1



print("")
print(" Proccessing:")
print("===================================\n");
# Insert Processing Code






print("")
print(" Calculate Answer:")
print("===================================\n");






print("")
print(" Answer:")
print("===================================\n");
print(f"Answer: \n{result}");