this code works but the computer says its wrong on submission.




while k<int(a[0][0]):

for i in range(len(a)):
a[i] = a[i].split(" ")

for i in range(1,len(a)):
if int(a[i][1])*int(a[i][2])<int(a[i][0]):

the code doesnt execute when submitted.
i tried it in the python IDLE with the example input and it worked fine.
is there a problem with presentation or is it bug?

please answer asap as this is for the live three hour competition happening right now.

Input() are always provided as String separated with spaces not as a tuple, dictionary, list or set.
so a[0][0] will be Index Out Of Range

First point; using the chat to solicit help in a live competition is not allowed.

Second, you are making life very hard for yourself, perhaps trying to use Python as though it is a different language - possible, but often messy and always confusing.

Here’s how to read an input line that is a single integer:

T = int(input())

And here’s a way to read a line that has exactly three space-separated integers:

M , N, K = map(int, input().split())

It’s possible to write a function that hands back space- & newline-separated input one item at a time too, but that’s less simple.

What is actually and specifically giving you a problem there is that your version of the value of T, the number of test cases, is based on converting only the first character of the string given (a[0][0]) instead of the whole string given (a[0]). This would show up on test input of say:

10 1 10
25 2 10
15 2 10
10 1 10
25 2 10
15 2 10
10 1 10
25 2 10
15 2 10
10 1 10
25 2 10
15 2 10

where the string 12 would be interpreted as integer 1.

Note for code clarity that input() always returns a string if successful, so str(input()) is a pointless function wrap.