Two printers suspected evaluation failure

Back to General discussions forum

cgchaconr     2016-08-25 04:21:33
User avatar

In this task when obtain the answers are closer but not the same, This is my code in Python: mylist="1 1 5 3 5 4" numbers = [int(s) for s in mylist.split()] result=[] for i in range(len(numbers)//3): X=numeros[i3] Y=numeros[i3+1] N=numeros[i3+2]
result.append((N
X*Y)//(X+Y))
print(" ".join(map(str,result)))

2 7

And in the example the answer is:

3 9

please one hint

Quandray     2016-08-25 06:53:55
User avatar

Hi,

For the first test case, 1 1 5, if both printers print 2 pages, that will take 2 seconds. Printing the fifth page will take another second, so the answer must be 3 seconds.

For the second test case, 3 5 4, if the first printer prints 3 pages (taking 9 seconds) and the second printer prints 1 page (taking 5 seconds) the answer is 9 seconds.

Please login and solve 5 problems to be able to post at forum