TnT/Multi_CodeNet4Repair huggingface dataset:
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):
a, b = map(int, input().split())

pa = int(a * 100/8)
pb = int(b * 100/10)

ans1 = None
ans2 = None

print(pa,pb)

for price in range(pb-1, pa+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans1 = price
        break

for price in range(pa-1, pb+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans2 = price
        break

if ans1 is None and ans2 is None:
    print(-1)
elif ans2 is None:
    print(ans1)
elif ans1 is None:
    print(ans2)
else:
    print(min(ans1,ans2))


a, b = map(int, input().split())

pa = int(a * 100/8)
pb = int(b * 100/10)

for price in range(pb, pa+1):
    if int(pa * 0.08) == a and int(pb * 0.1) == b:
        print(price)
        exit()

print(-1)

a, b = map(int, input().split())

pa = int(a * 100/8)
pb = int(b * 100/10)

ans1 = None
ans2 = None

for price in range(pb-1, pa+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans1 = price
        break

for price in range(pa-1, pb+2):
    if int(price * 0.08) == a and int(price * 0.1) == b:
        ans2 = price
        break

if ans1 is None and ans2 is None:
    print(-1)
elif ans2 is None:
    print(ans1)
elif ans1 is None:
    print(ans2)
else:
    print(min(ans1,ans2))


Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
def c_tax_increase():
    A, B = [int(i) for i in input().split()]
    lower = max((25 * A + 2 - 1) / 2, 10 * B)
    upper = min(25 * (A + 1) // 2, 10 * (B + 1))
    return lower if lower < upper else -1

print(c_tax_increase())

def c_tax_increase():
    A, B = [int(i) for i in input().split()]
    lower = max((25 * A + 2 - 1) // 2, 10 * B)
    upper = min(25 * (A + 1) // 2, 10 * (B + 1))
    return lower if lower < upper else -1

print(c_tax_increase())

Verdicts: Wrong Answer

Accepted
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):
def tax8(n):
    return int(n*(25/2))
    
def tax10(n):
    return int(n*(10/1))

a , b = map(int,input().split())

ans = -1

x = []
for i in range(1,a+1):
    if tax8(i) == a:
        x.append(i)
        
y = []
for i in range(1,b+1):
    if tax10(i) == b:
        y.append(i)
        
for i in x:
    if i in y:
        ans = i
        break
    
print(ans)

def tax8(n):
    return list(range(int((n-1)*(25/2))),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1))),int((n+1)*(10/1))))

a , b = map(int,input().split())

ans = -1

x = []
for i in range(1,a+1):
    if tax8(i) == a:
        x.extend(i)
        
y = []
for i in range(1,b+1):
    if tax10(i) == b:
        y.extend(i)
        
for i in x:
    if i in y:
        if int(i*(2/25)) == int(i*(1/10)):
            ans = i
            break
    
print(ans)

def tax8(n):
    return int(n*(1.08))
    
def tax10(n):
    return int(n*(1.1))

a , b = map(int,input().split())

ans = -1

x = []
for i in range(1,a+1):
    if tax8(i) == a:
        x.append(i)
        
y = []
for i in range(1,b+1):
    if tax10(i) == b:
        y.append(i)
        
for i in x:
    if i in y:
        ans = i
        break
    
print(ans)

def tax8(n):
    return list(range(int((n-1)*(25/2)),int((n+1)*(25/2))))
    
def tax10(n):
    return list(range(int((n-1)*(10/1)),int((n+1)*(10/1))))

a , b = map(int,input().split())

ans = -1

x = []

x.extend(tax8(a))
        
y = []

y.extend(tax10(b))

for i in x:
    if i in y:
        if int(i*(27/25))-i == a and int(i*(11/10))-i == b:
            ans = i
            break
    
print(ans)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
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):
A,B=map(int,input().split())
import math
a=math.ceil(A*100/8)
b=math.ceil((A+1)*100/8)
while math.floor(a*0.1)!=B and a<b:
  a+=1
  if a==b:
    print(-1)
  else:
    print(a)

A,B=map(int,input().split())
import math
a=math.ceil(A*100/8)
b=math.ceil((A+1)*100/8)
while math.floor(a*0.1)!=B and a<b:
  a+=1
if a==b:
  print(-1)
else:
  print(a)

Verdicts: Wrong Answer

Accepted
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 sys

def input():
    return sys.stdin.readline()[:-1]


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

A_ = []
B_ = []
for i in range(1, 1001):
	if i*8 //100 == A:
		A_.append(i)

	if i//10 == B:
		B_.append(i)

A_ = set(A_)
B_ = set(B_)
sel = A_ & B_
print(A_, B_)
if sel == set():
	print(-1)
else:
	print(min(sel))


import sys

def input():
    return sys.stdin.readline()[:-1]


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

A_ = []
B_ = []
end = False
for i in range(1, 1001):
	if i*8//100 == A and i//10 == B:
		print(i)
		end = True
		break
	else:
		continue
if end:
	pass
else:
	print(-1)


Verdicts: Wrong Answer

Accepted
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):
def main():
    a, b = map(int, input().split())
    x = 13
    while x <= int(a/0.08):
        x+=1
        if int(x*0.08) == a:
            if int(x*0.1) == b:
                return x
    return -1



if __name__ == "__main__":
    print(main()

import math
def main():
    a, b = map(int, input().split())
    ra = [math.ceil(i/0.08) for i in range(1, 102)]
    rb = [math.ceil(i/0.1) for i in range(1, 102)]
    x = ra[a-1] 
    while x < ra[a] :
        if int(x*0.1) == b:
            return x
        x+=1
    return -1



if __name__ == "__main__":
    print(main())

Verdicts: Runtime Error

Accepted
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):
a, b = map(int, input().split(" "))
for i in range(1, 1009):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        return
print(-1)

a, b = map(int, input().split(" "))
for i in range(1, 10000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        break

print(-1)

a, b = map(int, input().split(" "))
for i in range(1, 10000):
    if i * 0.08 == a and i * 0.1 == b:
        print(i)
        break

print(-1)


a, b = map(int, input().split(" "))
for i in range(1, 10000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        return
print(-1)

a, b = map(int, input().split(" "))
for i in range(1, 1009):
    if i * 0.08 == a and i * 0.1 == b:
        print(i)
        return
print(-1)

a, b = map(int, input().split(" "))

found = False
for i in range(1, 10000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        found = True
        break

if not found:
    print(-1)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
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):
A, B = list(map(int, input().split(' '))) 

res = -1

for i in range(1, 1010):
  q_A = int(i / A)
  q_B = int(i / B)
  if q_A == q_B:
    res = i
    break
  else:
    continue

print(i)

A, B = list(map(int, input().split(' '))) 
 
res = -1

for i in range(1, 1010):
  q_A = int(i * 0.08)
  q_B = int(i * 0.1)
  if q_A == A and q_B == B:
    res = i
    break
  else:
    continue
 
print(res)

Verdicts: Wrong Answer

Accepted
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):
a, b = map(int, input().split())

start = b * 10
flg = True
for i in range(10):
  tmp = (start + i) * 0.08
  if tmp == a:
    flg = False
    break
if flg:
  print('-1')
else:
  print(int(tmp))

a, b = map(int, input().split())

start = b * 10
flg = True
for i in range(10):
  tmp = (start + i) * 0.08
  if int(tmp) == a:
    flg = False
    break
if flg:
  print('-1')
else:
  print(int(tmp))


a, b = map(int, input().split())

start = b * 10
flg = True
for i in range(10):
  tmp = start + i
  if int(tmp*0.08) == a:
    flg = False
    break
if flg:
  print('-1')
else:
  print(int(tmp))

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
i = list(map(int, input().split()))

A = int(i[0])
B = int(i[1])

A_min = A // 0.08 + 1
A_max = ((A + 1) // 0.08)
B_min = B // 0.1 + 1
B_max = ((B+1) // 0.1)

if A_max < B_min:
    print(-1)
elif A_min > B_max:
    print(-1)
elif A_min < B_min:
    print(B_min)
else:
    print(A_min)

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

for i in range(2000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
print(-1)

Verdicts: Wrong Answer

Accepted
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):
a,b=map(int,input())

e=0
t=0

for i in range(1,100):
	if a<=i*0.08<a+1:
		e=i
	if b<=i*0.1<b+1:
		t=i
	if e==t:
		print(e)
        
print(-1)

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

for i in range(2000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
print(-1)

Verdicts: Runtime Error

Accepted
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):
a, b = map(int, input().split())

for n in range(10000):
    xa = n * 0.08
    xb = n * 0.1
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)

a, b = map(int, input().split())

for n in range(1000):
    xa = n * 0.08
    xb = n * 0.1
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)

a, b = map(int, input().split())

for n in range(1500):
    xa = int(n * 0.08)
    xb = int(n * 0.1)
    if a == xa and b == xb:
        print(n)
        exit()
print(-1)


Verdicts: Wrong Answer

Wrong Answer

Accepted
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 sys
A,B=map(int,input().split())
for i in range(1,1010):
  if i*0.1==B and i*0.08==A:
    print(i)
    sys.exit()
print(-1)

import sys
A,B=map(int,input().split())
for i in range(1,10000):
  if i*0.1==B and i*0.08==A:
    print(i)
    sys.exit()
print(-1)

import sys
A,B=map(int,input().split())
for i in range(1010):
  if int(i*0.1)==B and int(i*0.08)==A:
    print(i)
    sys.exit()
print(-1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
a, b = map(int, input().split())
money = 1
while money <1010:
  if money==a//0.08 and money == b//0.10:
    print(money)
  money+=1
  if money == 1010:
    print(-1)

a, b = map(int, input().split())
 
money = 1
while money < 1010:
  if money ==int(0.08*a) and money == int(0.10*b):
    print(money)
    break
  money+=1
  if money ==1010:
    print(-1)

a, b = map(int, input().split())

money = 1
while money < 1010:
  if money ==int(0.08*a) and money == int(0.10*b):
    print(money)
  money+=1
  if money ==1010:
    print(-1)

a, b = map(int, input().split())
 
money = 1
while money < 1010:
  if a ==int(0.08*money) and b == int(0.10*money):
    print(money)
    break
  money+=1
  if money ==1010:
    print(-1)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
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):
A, B = map(int, input().strip().split())

Amin=A*8//100
Amax=(A+1)*8//100
if (A+1)%0.08==0:
    Amax-=1

Bmin=B*10
Bmax=(B+1)*10
if (B+1)%0.1==0:
    Bmax-=1

ans=-1
flag=False
for a in range(Amin,Amax+1):
    for b in range(Bmin,Bmax+1):
        if a==b:
            ans=a
            flag=True
            break
    if flag:
        break
print(ans)

import math
A, B = map(int, input().strip().split())

Amin=math.ceil(A*100/8)
Amax=(A+1)*100//8
if Amax*8/100 == Amax*8//100:
    Amax-=1

Bmin=B*10
Bmax=(B+1)*10
if Bmax/10 == Bmax//10:
    Bmax-=1

ans=-1
flag=False
for a in range(Amin,Amax+1):
    for b in range(Bmin,Bmax+1):
        if a==b:
            ans=a
            flag=True
            break
    if flag:
        break
print(ans)

Verdicts: Wrong Answer

Accepted
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):
#include <stdio.h>

int main() {
  int a, b, x=-1;
  scanf("%d %d", &a, &b);
  for(int i=b*10; i<(b+1)*10; ++i) {
    if ((int)(i*0.08) == a) {
      x = i;
      break;
    }
  }
  printf("%d", x);
  return 0;
}


#include <stdio.h>

int main() {
  int a, b, x=-1;
  scanf("%d %d", &a, &b);
  for(int i=b*10; i<(b+1)*10; ++i) {
    if ((int)(i*0.08) == a) {
      x = i;
      break;
    }
  }
  printf("%d", x);
  return 0;
}


a, b = map(int, input().split())
for i in range(b*10, (b+1)*10):
  if int(i*0.08) == a:
    print(i)
    break
else:
  print(-1)

Verdicts: Runtime Error

Runtime Error

Accepted
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):
a, b = map(int, input().split())

upper = 1300

price = -1
for i in range(1, upper):
  tax8 = int(i*0.08)
  tax10 = int(i*0.1)
  if a == tax8 ans b == tax10:
    price = i
    break
    
print(price)

a, b = map(int, input().split())

upper = 1300

price = -1
for i in range(1, upper):
    tax8 = int(i * 0.08)
    tax10 = int(i * 0.1)
    if a == tax8 and b == tax10:
        price = i
        break

print(price)


Verdicts: Runtime Error

Accepted
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):
a, b = map(int, input().split())
for x in range(1000):
  if int((x + 1) * 0.08) == a and int((x + 1) * 0.1 == b):
    print(x)
    break
else:
  print(-1)

a, b = map(int, input().split())
for x in range(1, 1001):
  if int(x * 0.08) == a and int(x * 0.1) == b:
    print(x)
    break
else:
  print(-1)


Verdicts: Wrong Answer

Accepted
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 math
a,b = map(int,input().split())
a1 = math.round(a/0.08)
b1 = math.round(b/0.1)
c = min(a1,b1)
while True:
	if math.floor(c*0.08) == a and math.floor(c*0.1) == b:
		print(c)
		break
	elif math.floor(c*0.08) != a and math.floor(c*0.1) != b:
		print(-1)
		break
	else:
		c+=1


import math
a,b = map(int,input().split())
a1 = round(a/0.08)
b1 = round(b/0.1)
c = min(a1,b1)
while True:
	if math.floor(c*0.08) == a and math.floor(c*0.1) == b:
		print(c)
		break
	elif math.floor(c*0.08) > a and math.floor(c*0.1) > b:
		print(-1)
		break
	else:
		c+=1


Verdicts: Runtime Error

Accepted
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 math

A, B = map(int, input().split())
a = math.ceil(A / 0.08)
b = math.ceil(B / 0.1)
ans = max(a, b)

if ans ** 0.08 == A and ans ** 0.1 == B:
    print(ans)
else:
    print(-1)

import math

A, B = map(int, input().split())
a = math.ceil(A / 0.08)
b = math.ceil(B / 0.1)
ans = max(a, b)

if math.floor(ans * 0.08) == A and math.floor(ans * 0.1) == B:
    print(ans)
else:
    print(-1)


Verdicts: Wrong Answer

Accepted
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):
#!/usr/bin/env python
import sys

input = sys.stdin

def tax(pct8, pct10):
    pct8low = pct8 / 0.08
    pct8high_x10 = (pct8 + 1) * 125
    if pct8high_x10 % 10 == 0:
        pct8high = pct8high_x10 / 10 - 1
    else:
        pct8high = pct8high_x10 / 10


    pct10low = pct10 * 10
    pct10high = (pct10 + 1) * 10

    #  8 H---------------L
    # 10     H-----------*----L
    #    <or>
    #  8     H------------*--L
    # 10 H----------------L
    #    <or>
    #  8     H---------------L
    # 10 H-------------------*-----L
    #    <or>
    #  8 H-------------------*-----L
    # 10     H---------------L
    if pct8high < pct10low or pct10high < pct8low:
        return -1
    else:
        return max(pct8low, pct10low)


pct8, pct10 = map(int, input.readline().split(" "))
print(tax(pct8, pct10))


#!/usr/bin/env python
import sys

input = sys.stdin

def tax(pct8, pct10):
    pct8low = pct8 / 0.08
    pct8high = (pct8 + 1) / 0.08

    pct10low = pct10 / 0.1
    pct10high = (pct10 + 1) / 0.1

    #  8 H---------------L
    # 10     H-----------*----L
    #    <or>
    #  8     H------------*--L
    # 10 H----------------L
    #    <or>
    #  8     H---------------L
    # 10 H-------------------*-----L
    #    <or>
    #  8 H-------------------*-----L
    # 10     H---------------L
    if pct8high < pct10low or pct10high < pct8low:
        return -1
    else:
        return max(pct8low, pct10low)


pct8, pct10 = map(int, input.readline().split(" "))
print(tax(pct8, pct10))




#!/usr/bin/env python
import sys

input = sys.stdin

def tax(pct8, pct10):
    pct8low_x10 = pct8 * 125
    if pct8low_x10 % 10 == 0:
        pct8low = pct8low_x10 // 10
    else:
        pct8low = pct8low_x10 // 10 + 1

    pct8high_x10 = (pct8 + 1) * 125

    if pct8high_x10 % 10 == 0:
        pct8high = pct8high_x10 // 10 - 1
    else:
        pct8high = pct8high_x10 // 10

    pct10low = pct10 * 10
    pct10high = (pct10 + 1) * 10 - 1

    if pct8high < pct10low or pct10high < pct8low:
        return -1
    else:
        return max(pct8low, pct10low)

#def test():

#        for j in range(1, 100+1):
#            price = tax(i, j)
#            if price > 0:
#                if int(price *.08) != i or int(price * .1) != j:
#                    print(f"Wrong! tax({i},{j}) -> {price} but price*0.8={int(price*0.08)} and price*0.1={int(price*0.1)}")

pct8, pct10 = map(int, input.readline().split(" "))
print(tax(pct8, pct10))
#test()


Verdicts: Wrong Answer

Wrong Answer

Accepted
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 math

a = list(map(int, input().split()))
b = -1
for i in range(1250):
    x = math.floor(i*0.08)
    y = math.floor(i*0.1)
    if a[0] == x and a[1] == y:
        b = x
        break

print(b)

import math

a = list(map(int, input().split()))
b = -1
for i in range(1001):
    x = math.floor(i*0.08)
    y = math.floor(i*0.1)
    if a[0] == x and a[1] == y:
        b = i
        break

print(b)

Verdicts: Wrong Answer

Accepted
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):
# -*- coding: utf-8 -*-
def main():
    A,B = map(int,input().split())
    for i in range(1,1010):
        if (0.08*i)==A and (0.1*i)==B:
            print(i)
            return
    print('-1')

if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-
def main():
    A,B = map(int,input().split())
    for i in range(1,1010):
        if int(0.08*i)==A and int(0.1*i)==B:
            print(i)
            return
    print('-1')

if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

Accepted
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):
a,b=map(int,input().split())
xa=a/0.08
xb=b/0.1
if xa*0.08==xb*0.1:
    print(xa*0.08)
else:
    print(-1)

import math
a,b=map(int,input().split())
xa=math.ceil(a/0.08)
xb=int(b/0.1)
if int(max(xa,xb)*0.08)==a and int(max(xa,xb)*0.1)==b:
    print(max(xa,xb))
else:
    print(-1)

Verdicts: Wrong Answer

Accepted
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):
A, B = map(int, input().split())
p = -1
for i in range(101):
  if (108 * i) // 100 == A and (11 * i) // 10 == B:
    p = i
    break
print(p)

A, B = map(int, input().split())
p = -1
for i in range(100001):
  if (108 * i) // 100 - i == A and (11 * i) // 10 - i == B:
    p = i
    break
print(p)


Verdicts: Wrong Answer

Accepted
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):
a,b = map(int,input())

for i in range(0,100):
    if int(i*1.08) == a and int(i*1.1) == b:
        print(i)
        exit()
        
print(-1)

a,b = map(int,input().split())

for i in range(100):
    if int(i*1.08) == a and int(i*1.1) == b:
        print(i)
        exit()

print(-1)

from sys import stdin
a,b = map(int,stdin.readline().rstrip().split())
for i in range(1001):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        exit()
print(-1)

Verdicts: Runtime Error

Wrong Answer

Accepted
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 sys
A,B = map(int,input().split())
if A<13:
  print(-1)
  sys.exit()
last = 2000

for i in range(last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  print(mA,mB,i)

  
  if mA==A and mB==B:
    print("match")
    print(i)
    break
  if i==last-1:
    print("-1")

import sys
A,B = map(int,input().split())
if A<13:
  print(-1)
  sys.exit()
last = 2000

for i in range(last):
  mA = int(i*0.08)
  mB = int(i*0.10)

  
  if mA==A and mB==B:
    print(i)
    break
  if i==last-1:
    print("-1")

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

last = 2000
for i in range(last):
  mA = int(i*0.08)
  mB = int(i*0.10)

  
  if mA==A and mB==B:
    print("match")
    print(i)
    break
  if i==last-1:
    print("-1")

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

last = 2000

for i in range(12,last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  
  if mA==A and mB==B:
    print(i)
    break
  if i==last-1:
    print("-1")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
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):

A, B = [int(i) for i in input().split()]

aa = A / 0.08
bb = B / 0.1


if aa > (bb + 10) or bb > (aa + 12.5):
    print('-1')
else:
    if aa > bb:
        print(aa)
    else:
        print(bb)
        


A, B = [int(i) for i in input().split()]

aa = A / 0.08
bb = B / 0.1


if aa > bb:
    if B == int(aa * 0.1):
        print(aa)
    else:
        print('-1')
else:
    if A == int(bb*0.08):
        print(bb)
    else:
        print('-1')        
        



A, B = [int(i) for i in input().split()]

aa = A / 0.08
bb = B / 0.1


if aa > bb:
    if B == int(aa * 0.1):
        print(aa)
    else:
        print(-1)
else:
    if A == int(bb*0.08):
        print(bb)
    else:
        print('-1')        
        

import math

A, B = [int(i) for i in input().split()]

aa = math.ceil(A / 0.08)
bb = math.ceil(B / 0.1)


if aa > bb:
    if int(aa * 0.08) != A or int(aa * 0.1) != B:
        print('-1')
    else:
        print(aa)
else:
    if int(bb * 0.08) != A or int(bb * 0.1) != B:
        print('-1')
    else:
        print(bb)
        

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
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):
a, b = map(int, input().split())

pa = 0 - -a//0.08
pb = b/0.1
ans = pa

ta = pa//12.5
tb = pa//10

print(ta, tb)

if ta == a and tb == b:
    for i in range(100):
        ans = pa - 1
        if ans//12.5 != a or ans//10 != b:
            ans = ans + 1
            print(int(ans))
            break
else:
    print(-1)

a, b = map(int, input().split())

pa = 0 - -a//0.08
pb = b/0.1
ans = pa

ta = pa//12.5
tb = pa//10

if ta == a and tb == b:
    for i in range(100):
        ans = pa - 1
        if ans//12.5 != a or ans//10 != b:
            ans = pa + 1
            print(int(ans))
            break
else:
    print(-1)

a, b = map(int, input().split())

for i in range(1100):
    if i//12.5 == a and i//10 == b:
        print(i)
        exit()

print(-1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
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 math

a,b = map(int,input().split())

if math.floor(a*12.5) == math.floor(b*10):
  print(math.floor(b*10)
else:
  print("-1")

a,b=map(int,input().split())
c=[]

for i in range(1240):
  if int(i*0.08) == a and int(i*0.1) == b:
    c.append(i)
c.append(-1)

print(c[0])

Verdicts: Runtime Error

Accepted
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):
a,b=map(int,input().split())
am=a*(100/108)
aM=(a+1)*(100/108)
bm=b*(100/110)
bM=(b+1)/(100/110)
for i in range(101):
    if am<=i<aM and bm<=i<bM:
        print(i)
        exit(0)
    elif i==100:
        print('-1')

a, b = map(int, input().split())
for i in range(1, 2000):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    print(i)
    exit()
print(-1)
    

Verdicts: Wrong Answer

Accepted
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):
#!/usr/bin/env python3
import math

a, b = map(int, input().split())
x = math.floor((a-1)/0.08)
y = math.floor((a+1)/0.08)
z = math.floor((b-1)/0.1)
w = math.floor((b+1)/0.1)

if y<z:
    print(-1)
    exit(0)

ans = []
for i in range(min(x,z), min(y,w)):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans.append(i)

if len(ans) == 0:
    print(-1):
else:
    print(min(ans))


#!/usr/bin/env python3
import math

a, b = map(int, input().split())
x = math.floor((a-1)/0.08)
y = math.floor((a+1)/0.08)
z = math.floor((b-1)/0.1)
w = math.floor((b+1)/0.1)

if y<z:
    print(-1)
    exit(0)

ans = []
for i in range(min(x,z), min(y,w)):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans.append(i)

if len(ans) == 0:
    print(-1)
else:
    print(min(ans))


Verdicts: Runtime Error

Accepted
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):
from math import *
A,B=list(map(input().split()))
x=ceil(max(A/0.08,B/0.1))
y=min((A+1)/0.08,(B+1)/0.1)
if x<y:
  print(x)
else:
  print(-1)

from math import *
A,B=list(map(int, input().split()))
x=ceil(max(A/0.08,B/0.1))
y=min((A+1)/0.08,(B+1)/0.1)
if x<y:
    print(x)
else:
    print(-1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has a string S consisting of lowercase English letters.  Starting with this string, he will produce a new one in the procedure given as follows.  The procedure consists of Q operations. In Operation i (1 \leq i \leq Q), an integer T_i is provided, which means the following:    * If T_i = 1: reverse the string S.    * If T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.      * If F_i = 1 : Add C_i to the beginning of the string S.     * If F_i = 2 : Add C_i to the end of the string S.  Help Takahashi by finding the final string that results from the procedure.

Submission attempts (in order):
S = list(input())
Q = int(input())
S_r = []
S_l = []

n = 0

for i in range(Q):
  q = list(input().split())
  if int(q[0]) == 1:
    n += 1
  else:
      if int(q[1]) == 1:
        S_l.append(q[2])
        S_r = S
        n += 1
        break
      else:
        S_r.append(q[2])
        S_l = S
        n += 1
        break

  if i == Q-1:
    print(''.join(S_l[::-1]), end="")
    print(''.join(S), end="")
    print(''.join(S_r))

for i in range(Q - n):
  q = list(input().split())
  if int(q[0]) == 1:
    temp = S_r[-1]
    S_r[-1] = S_l[-1]
    S_l[-1] = temp
  else:
    if int(q[1]) == 1:
      S_l.append(q[2])
    else:
      S_r.append(q[2])

print(S_l)
print(S_r)
print(''.join(S_l[::-1]), end="")
print(''.join(S_r))

S = list(input())
Q = int(input())
S_r = []
S_l = []

n = 0

for i in range(Q):
  q = list(input().split())
  if int(q[0]) == 1:
    n += 1
  else:
      if int(q[1]) == 1:
        S_l.append(q[2])
        S_r = S
        n += 1
        break
      else:
        S_r.append(q[2])
        S_l = S
        n += 1
        break

  if i == Q-1:
    if not S_r and not S_l
      print(''.join(S))
    elif not S_r
      print(''.join(S_l[::-1]), end="")
      print(''.join(S))
    elif not S_l
      print(''.join(S), end="")
      print(''.join(S_r))

for i in range(Q - n):
  q = list(input().split())
  if int(q[0]) == 1:
    temp = S_r[-1]
    S_r[-1] = S_l[-1]
    S_l[-1] = temp
  else:
    if int(q[1]) == 1:
      S_l.append(q[2])
    else:
      S_r.append(q[2])

print(''.join(S_l[::-1]), end="")
print(''.join(S_r))

S = list(input())
S_r = []
Q = int(input())
R = True

for i in range(Q):
  q = list(input().split())
  if int(q[0]) == 1:
    R = not R
  else:
    if int(q[1]) == 1:
      if R:
        S_r.append(q[2])
      else:
        S.append(q[2])
    else:
      if R:
        S.append(q[2])
      else:
        S_r.append(q[2])

if not S_r:
  if R:
    print(''.join(S))
  else:
    print(''.join(S[::-1]))
else:
  if R:
    print(''.join(S_r[::-1]), end="")
    print(''.join(S))
  else:
    print(''.join(S[::-1]), end="")
    print(''.join(S_r))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi has a string S consisting of lowercase English letters.  Starting with this string, he will produce a new one in the procedure given as follows.  The procedure consists of Q operations. In Operation i (1 \leq i \leq Q), an integer T_i is provided, which means the following:    * If T_i = 1: reverse the string S.    * If T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.      * If F_i = 1 : Add C_i to the beginning of the string S.     * If F_i = 2 : Add C_i to the end of the string S.  Help Takahashi by finding the final string that results from the procedure.

Submission attempts (in order):
s = input()
q = int(input())

query = []
rev=1

for i in range(q):
    query.append(input().split())

for i in range(q):
    if query[i][0]=="1":
        rev*=-1
    else:
        if rev==1:
            if query[i][1]=="1":
                s.appendleft(query[i][2])
            else:
                s.append(query[i][2])
        else:
            if query[i][1]=="2":
                s.appendleft(query[i][2])
            else:
                s.append(query[i][2])

if rev==-1:
    s = s[::-1]
print(s)

s = input()
q = int(input())

query = [""]*q

for i in range(q):
    query[i] = input()
    if query[i]=="1":
        s = list(reversed(s))
    else:
        r = query[i].split()
        if r[1]=="1":
            s = r[2]+s
        else:
            s += r[2]

print(s)

s = input()
q = int(input())

query = [""]*q

rev=1

for i in range(q):
    query[i] = input()
    if query[i]=="1":
        rev*=-1
    else:
        r = query[i].split()
        if rev=1:
            if r[1]=="1":
                s = r[2]+s
            else:
                s += r[2]
        else:
            if r[1]=="2":
                s = r[2]+s
            else:
                s += r[2]

if rev=-1:
    s = s[::-1]
print(s)

s = input()
q = int(input())

query = []
t = []
f = []
c = []

for i in range(q):
    query[i] = input()
    if query[i]=="1":
        t.append(1)
    else:
        r = query[i].split()
        t.append(2)
        f.append(int(r[1]))
        c.append(r[2])

for i in range(q):
    if t[i]==1:
        s = s[::-1]
    elif t[i]==2:
        if f[i]==1:
            s = c[i]+s
        elif t[i]==2:
            s = s+c[i]
print(s)

from collections import deque

s = deque(input())
q = int(input())

query = []
rev=1

for i in range(q):
    query.append(input().split())

for i in range(q):
    if query[i][0]=="1":
        rev*=-1
    else:
        if rev==1:
            if query[i][1]=="1":
                s.appendleft(query[i][2])
            else:
                s.append(query[i][2])
        else:
            if query[i][1]=="2":
                s.appendleft(query[i][2])
            else:
                s.append(query[i][2])

result="".join(list(s))
if rev==-1:
    result = result[::-1]
print(result)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi has a string S consisting of lowercase English letters.  Starting with this string, he will produce a new one in the procedure given as follows.  The procedure consists of Q operations. In Operation i (1 \leq i \leq Q), an integer T_i is provided, which means the following:    * If T_i = 1: reverse the string S.    * If T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.      * If F_i = 1 : Add C_i to the beginning of the string S.     * If F_i = 2 : Add C_i to the end of the string S.  Help Takahashi by finding the final string that results from the procedure.

Submission attempts (in order):
from collections import deque

S = input().rstrip('\r\n')
S_list = deque(S)
reverse_flg = False

Q = int(input())
for _ in range(Q):
    query = input().rstrip('\r\n')
    t, f, c = '', '', ''
    if len(query) == 1:
        t = query
    else:
        t, f, c = query.split(' ')
    if t == '1':
        reverse_flg = not reverse_flg
    else:
        if f == '1':
            S_list.appendleft(c)
        else:
            S_list.append(c)
if reverse_flg:
    S_list.reverse()
print(''.join(S_list))

from collections import deque

S = input().rstrip('\r\n')
S_list = deque(S)
is_reverse = False

Q = int(input())
for _ in range(Q):
    query = input().rstrip('\r\n')
    t, f, c = '', '', ''
    if len(query) == 1:
        t = query
    else:
        t, f, c = query.split(' ')
    if t == '1':
        is_reverse = not is_reverse
    else:
        if f == '1':
            if is_reverse:
                S_list.append(c)
            else:
                S_list.appendleft(c)
        else:
            if is_reverse:
                S_list.appendleft(c)
            else:
                S_list.append(c)
if is_reverse:
    S_list.reverse()
print(''.join(S_list))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has a string S consisting of lowercase English letters.  Starting with this string, he will produce a new one in the procedure given as follows.  The procedure consists of Q operations. In Operation i (1 \leq i \leq Q), an integer T_i is provided, which means the following:    * If T_i = 1: reverse the string S.    * If T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.      * If F_i = 1 : Add C_i to the beginning of the string S.     * If F_i = 2 : Add C_i to the end of the string S.  Help Takahashi by finding the final string that results from the procedure.

Submission attempts (in order):
s = list(input())
q = int(input())
judge = 1
front = []
back = []
for i in range(q):
  d = input()
  if d == '1':
    judge *= -1
  else:
    a, b, c = list(d.split())
    b = int(b)
    if (b == 1 and judge ==1) or (b == 2 and judge == -1):
      front.append(c)
    else:
      back.append(c)
ans = front + s + back
if judge == 1:
  print(*ans,sep='')
else:
  print(*ans[::-1], sep='')

s = list(input())
q = int(input())
judge = 1
front = []
back = []
for i in range(q):
  a = list(map(str,input().split()))
  if int(a[0]) == 1:
    judge *= -1
  else:   
    if (int(a[1]) == 1 and judge == 1) or (int(a[1]) == 2 and judge == -1):
      front.append(a[2])
    else:
      back.append(a[2])
ans = front[::-1] + s + back
if judge == -1:
  ans.reverse()
print(*ans, sep='')

Verdicts: Wrong Answer

Accepted