So, below is my code written in python. This code is fairly working in IDE. 
But, I tried to upload this code 5 times and each time judgement fails. I am 
new to GCJ and don't know exactly where I am making mistake. 

T = int(input())
result = []
for i in range(T):
    a = input()
    a = a.split(" ")
    destination = int(a[0])
    horses = int(a[1])
    min = 0
    travelled = 0
    r = 0
    for j in range(horses):
        b = input()
        b = b.split(" ")

        if j ==0:
            travelled = int(b[0])
            min = int(b[1])
        elif j > 0 and(int(b[1])<min):
            travelled = int(b[0])
            min = int(b[1])
    if travelled < destination:
        r = destination-travelled
        r = r/min
        r = destination/r

    s = "Case #"+str(i+1)+": "+"%.6f" % r
    result.append(s)

for i in result:
    print(i)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/b2744b3f-dd61-4e71-ab96-5662814632b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to