Problem: Find the price of a product before tax such that, when the consumption tax rate is 8 percent and 10 percent, the amount of consumption tax levied on it is A yen and B yen, respectively. (Yen is the currency of Japan.)  Here, the price before tax must be a positive integer, and the amount of consumption tax is rounded down to the nearest integer.  If multiple prices satisfy the condition, print the lowest such price; if no price satisfies the condition, print `-1`.

Submission attempts (in order):
import decimal
decimal.getcontext().prec = 4
A, B = map(int, input().split())
 
A_price = (A / 8) * 100
 
B_price = (B / 10) * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = (int(A_price) / 100) * 10
    Y = (int(B_price) / 100) * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

A,B = map(int, input().split())
A_place = A / 0.08
B_place = B / 0.1

if int(A_place) == int(B_place):
  print(A_place)
else:
  print(-1)

import decimal
decimal.getcontext().prec = 4
A, B = map(int, input().slit())
 
A_price = (A / 8) * 100
 
B_price = (B / 10) * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = (int(A_price) / 100) * 10
    Y = (int(B_price) / 100) * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

A, B = map(int, input().slit())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = int(A_price) / 100 * 10
    if B == int(X):
    	print(A_price)
    else:
    	print(-1)

A, B = map(int, input().slit())

A_price = A // 8 * 100

B_price = B // 10 * 100

if A_price == B_price:
  print(A_price)
else:
  print(-1)
  

A, B = map(int, input().slit())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100


if int(A_price) == int(B_price):
  print(int(A_price))
else:
  print(-1)
  

A, B = map(int, input().slit())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100

if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = int(A_price) / 100 * 10
    if B == X:
    	print(A_price)
    else:
    	print(-1)


A, B = map(int, input().slit())
 
A_price = (A / 8) * 100
 
B_price = (B / 10) * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = (int(A_price) / 100) * 10
    Y = (int(B_price) / 100) * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)


A, B = map(int, input().split())
 
A_price = A / 8 * 100
 
B_price = B / 10 * 100
 
if int(A_price) == int(B_price):
	print(int(A_price))
else:
	X = int(A_price) / 100 * 10
    Y = int(B_price) / 100 * 8
    if B == int(X):
    	print(int(A_price))
    elif A == int(Y):
    	print(int(B_price))
    else:
    	print(-1)

A,B = map(int, input().split())
num = 0
while num < 1011:
  num += 1
  X = num * 0.08
  if int(X) == A:
    Y = num * 0.1
    if int(Y) == B:
      print(num)
      break
    else:
      pass
  elif num == 1010:
    print(-1)
    break
  else:
    pass


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted