# Help me in solving BETDEAL problem

### My issue

I can’t able to figure-it out what was problem in my code?

### My code

``````# cook your dish here
t = int(input())
for _ in range(t):
a,b = map(int,input().split())
# if((100-a/100)>(200-b/100)):
#     print("FIRST")
# elif((100-a/100)==(200-b/100)):
#     print("BOTH")
# else:
#     print("SECOND")
c = 100 - int(100*a/100)
d = 200 - int(200*b/100)
if(c>d):
print("FIRST")
elif(c<d):
print("SECOND")
else:
print("BOTH")
``````

Problem Link: BETDEAL Problem - CodeChef

@satya_praveen
In the given problem, we have to find the store with minimum price.

In your code, you are checking if the price in first store is greater than second one or not. If true, your code is printing FIRST, which is incorrect, as its price is more than second one.

The actual output is inversely proportional to the greater price, i.e, if price in first is more then output is SECOND and vice-versa.

Here is my code for reference.

``````# cook your dish here
for _ in range(int(input())):
a,b=map(int,input().split())
d=(100-a)-(200-(2*b))
if(d<0):
print('First')
elif(d==0):
print('BOTH')
else:
print('Second')

``````