while k<int(a[0][0]):
a.append((str(input())))
k+=1
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]):
print(“YES”)
else:
print(“NO”)
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.
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: