Problem:


Score : 300 points

Problem Statement

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.

Constraints

1 \leq A \leq B \leq 100

A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

If there is a price that satisfies the condition, print an integer representing the lowest such price; otherwise, print -1.

Sample Input 1

2 2

Sample Output 1

25

If the price of a product before tax is 25 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 25 \times 0.08 \rfloor = \lfloor 2 \rfloor = 2 yen.

When the consumption tax rate is 10 percent: \lfloor 25 \times 0.1 \rfloor = \lfloor 2.5 \rfloor = 2 yen.

Thus, the price of 25 yen satisfies the condition. There are other possible prices, such as 26 yen, but print the minimum such price, 25.

Sample Input 2

8 10

Sample Output 2

100

If the price of a product before tax is 100 yen, the amount of consumption tax levied on it is:

When the consumption tax rate is 8 percent: \lfloor 100 \times 0.08 \rfloor = 8 yen.

When the consumption tax rate is 10 percent: \lfloor 100 \times 0.1 \rfloor = 10 yen.

Sample Input 3

19 99

Sample Output 3

-1

There is no price before tax satisfying this condition, so print -1.



Sample input:
2 2


Sample output:
25

Submission status: Accepted

Solution code:
import math

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

# 8 percent of x is a
# x = a/0.08 
x=[]
for i in range(10000):
	if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
		x.append(i)

if not len(x)==0:
	print(min(x))
else: print("-1")

Submission status: Accepted

Solution code:
import math

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

a = []
b = []

for i in range(1,1001):
  if math.floor(i*0.08) == A:
    a.append(i)
    
  else:
    pass

for i in range(1,1001):
  if math.floor(i*0.1) == B:
    b.append(i)
    
  else:
    pass
   
a_and_b = set(a) & set(b)


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

Submission status: Accepted

Solution code:
#X*0.08=A
#X*0.10=B

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

#X*0.08=A.0~A.9999...

X1=A/0.08
X2=(A+0.999)/0.08

Y1=B/0.10
Y2=(B+0.999)/0.10

#print(X1,X2)
#print(Y1,Y2)

#お互いが満たす数値の中で、最小のものを出力する
#X1~X2 Y1~Y2

import math

# 切り上げ
X1=math.ceil(X1)
Y1=math.ceil(Y1)

# 切り捨て
X2=math.floor(X2)
Y2=math.floor(Y2)

#片方を下から上まで見て、領域が一致するところがあればそれが答え
for i in range(X1,X2+1):
    if Y1<=i and i<=Y2:
        print(i)
        exit()
#重なる領域がなかったら-1出力
print("-1")

Submission status: Accepted

Solution code:
from math import floor
a, b = map(int, input().split())
for i in range(1, 1010):
    if floor(i*0.08) == a and floor(i*0.1) == b:
        print(floor(i))
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys
import numpy as np
A, B = map(int,input().split())
amin, amax = A / 0.08, (A + 1) / 0.08
bmin, bmax = B / 0.10, (B + 1) / 0.10

if amax <= bmin or bmax <= amin:#解なし：区間重なりなし
    print(-1)
    sys.exit()

ans = np.ceil(max(amin, bmin)).astype(int)

if ans >= amax or ans >= bmax:
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
import math
import sys
 
a,b = map(int,input().split())
 
a_min = math.ceil(a/0.08)
a_max = math.ceil((a+1)/0.08-1)
 
b_min = math.ceil(b/0.1)
b_max = math.ceil((b+1)/0.1-1)
 
a_list = list(range(a_min,a_max+1))
b_list = list(range(b_min,b_max+1))
 
 
for num in a_list:
    if num in b_list:
        print(num)
        sys.exit()
 
print('-1')

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = -1
for i in range(1, 1250):
    if int(i*0.08) == a and int(i*0.10) == b:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

for i in range(10000):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = -1
for i in range(1010):
    if int(i*0.08) == a and int(i*0.1) == b:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
result = 'No'
for i in range(1, 1500):
    eight = math.floor(i * 0.08)
    ten = math.floor(i * 0.10)
    if eight == A and ten == B:
        print(i)
        result = 'Yes'
        break
if result == 'No':
    print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
ans = -1

for i in range(1, 1250):
    if int(i*0.08)==a and int(i*0.1)==b:
       ans = i
       break

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

for i in range(10000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for i in range(1, 100000):
    if (a <= i * 0.08 and i * 0.08 < a + 1) and (b <= i * 0.1 and i * 0.1 < b + 1):
        print(i)
        exit()
    else:
        continue

print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = -1
for i in range(1, 1250):
    if int(i/100*8) == a and int(i/10) == b:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
# 158-C
a, b = map(int, input().split())
ans = -1
for i in range(1, 1250):
    if int(i/100*8) == a and int(i/10) == b:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split(" "))

sentinel1 = 0
N = 1
while sentinel1 < 101:
    sentinel1 = int(N * 0.08)
    sentinel2 = int(N * 0.1)
    if sentinel1 == A:
        if sentinel2 == B:
            print(N)
            sys.exit()
    N = N + 1

print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input(). split())
answer = None
flag = False
for i in range(1, 1009):
  
  if (A == (i*0.08)//1) and (B == (i*0.1)//1):
    answer = i
    print(answer)
    flag = True
   
    if flag:
        break
if answer is None:
  answer = -1
  print(answer)

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))

ans = -1
for i in range(10):
  if (A[1]*10+i)*0.08//1 == A[0]:
    ans = A[1]*10+i
    break
    
print(ans)

Submission status: Accepted

Solution code:
A, B = (int(i) for i in input().split())  
A_list = []
for i in range(8001):
    tmp = int(i*0.08)
    if tmp==A:
        A_list.append(i)
B_list = []
for i in range(10001):
    tmp = int(i*0.1)
    if tmp==B:
        B_list.append(i)
and_list =  set(A_list)&set(B_list)
try:
    print(min(and_list))
except:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

for i in range(10, 1001):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    print(i)
    exit()
print(-1)

Submission status: Accepted

Solution code:
import math
#切り上げceil,切り捨てfloor
a,b=map(int,input().split())
flag=0
for i in range(1,10000):
  if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
    print(i)
    flag=1
    break
if flag==0:
  print(-1)

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
s = 0
for i in  range(1,1100):
    if (math.floor(i*0.08) == a and math.floor(i*0.1) == b):
        s = i
        break
    s = -1
print(s)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

list = []
if 100*a%8:
  x=int(a/0.08)+1
else:
  x=int(a/0.08)

if 100*(a+1)%8:
    y=int((a+1)/0.08)
else:
    y=int((a+1)/0.08)-1

    
for i in range(x, y+1):
    if b/0.1 <= i <(b+1)/0.1:
        list.append(i)

        
list = sorted(list)
if list:
    print(list[0])
else:
    print('-1')

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
for i in range(1001):
	if int(i*(8/100))==a and int(i*(10/100))==b:
		print(i)
		break
else:
	print(-1)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc158/tasks/abc158_c
# -*- coding: utf-8 -*-
A,B = map(int,input().split())
for i in range(10,1009):
  if(int(i*0.08)==A and int(i*0.1)==B):
    print(i)
    flag=0
    break
  else:
    flag=1
if flag==1:
  print("-1")

Submission status: Accepted

Solution code:
import math
text = list(map(int, input().split()))

reply = -1
i = 0
while math.floor(i * 0.08) <= text[0] and math.floor(i * 0.1) <= text[1]:
    if math.floor(i * 0.08) == text[0] and math.floor(i * 0.1) == text[1]:
        reply = i
        break
    i += 1
print(reply)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
Arate = 0.08
Brate = 0.10

flag = False
for i in range(1,1009):
  tmpA = int(i*Arate)
  tmpB = int(i*Brate)

  if tmpA == A and tmpB == B:
    print(i)
    flag = True
    break


if flag is False: print(-1)

Submission status: Accepted

Solution code:
# coding: utf-8

import math
import decimal

# 標準入力 <int><int>
A, B = map(int, input().split())

tax8 = decimal.Decimal('0.08')
tax10 = decimal.Decimal('0.1')

ans = -1

for i in range(1, 1100):
    if math.floor(i * tax8) == A and math.floor(i * tax10) == B:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for x in range(1009):
    if int(x*0.08) == a and int(x*0.10) == b:
        print(x)
        exit()
print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

ans = -1

for p in range(13, 1350):
    if int(p * 0.08) == A and int(p * 0.1) == B:
        ans = p
        break

print(ans)

Submission status: Accepted

Solution code:
import math
a,b=list(map(int,input().split()))
ans=-1
for i in range(1,1100):
  if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
    ans=i
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = (int(x) for x in input().split())
for n in range(0,1009):
  za = n*8//100
  zb = n*10//100
  if za == A and zb == B:
    print(n)
    exit()
print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())

s=-1
for i in range(10,1250):
    if A==int(0.08*i) and B==int(0.1*i):
        s=i
        break

print(s)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for n in range(1,10**6):
  if (n*8)//100 == a and n//10 == b:print(n);exit()
print(-1)

Submission status: Accepted

Solution code:
a, b = list(map(int,input().split()))

for p in range(1000):
  if int((p + 1) * 0.08) == a and int((p + 1) * 0.1) == b:
    print(p + 1)
    break
  if p == 999:
    print('-1')

Submission status: Accepted

Solution code:
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
inf = 10**9


def main():
    a, b = list(map(int, input().split()))
    l = []
    for i in range(math.ceil(max(a/0.08, b/0.1)), math.ceil(min((a+1)/0.08, (b+1)/0.1))):
        l.append(i)
    if l:
        print(l[0])
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x, y = list(map(int,(input().split())))

for a in range(1,10001):
    if int(a * 0.1) == y:
        if int(a * 0.08) == x:
            print(a)
            exit()
print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

for p in range(13, 1250):
	if int(p * 0.08) == A and int(p * 0.1) == B:
		print(p)
		exit()

print(-1)

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
min = b*10
max = (b+1)*10
flag = True
for i in range (min, max):
  if a*100/8 <= i and i < (a+1)*100/8:
    print(i)
    flag = False
    break
    
if flag:
  print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
i=0
while i<1001:
    X=int(i*0.08)
    Y=int(i*0.10)
    if A==X and B==Y:
        break
    i=i+1
if i==1001:
    i=-1
    print(i)
else:
    print(i)

Submission status: Accepted

Solution code:
def tax_increase(a,b):
    t8  = 0.08
    t10 = 0.1
    for i in range(b*10,(b+1)*10,1):
        if int(i*t8) == a:
            return i
    return -1
    
if __name__ == '__main__':
    a,b = map(int,input().split())
    ans = int(tax_increase(a,b))
    print(ans)

Submission status: Accepted

Solution code:
tax8 = 0.08
tax10 = 0.1

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

t8  = int(a / tax8)
t10 = int(b / tax10)

tmp8 = 0
for i in range(t8,0,-1):
  if(not (int(i * tax8) == a)):
    tmp8 = i + 1
    break

l = []
for i in range(tmp8,tmp8+20):
  if(int(i * tax8) == a):
    l += [i]
  else:
    break

ll = []
for i in l[::-1]:
  if(int(i * tax10) == b):
    ll += [i]

if(not (ll == [])):
  print(min(ll))
else:
  print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
ans=1
while ans>0 :
    a_ans=math.floor(ans*0.08)
    b_ans=math.floor(ans*0.1)
    if a_ans==a and b_ans==b:
        break
    elif a_ans>a or b_ans>b:
        ans=-1
        break
    else:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# スペース区切りの文字列の入力
st = input().split()

for i in range(1001):
  #切り捨て
  a = int(i * 0.08)
  b = int(i * 0.1)
  if(a == int(st[0]) and b == int(st[1])):
    print(i)
    break;
  elif(i == 1000):
    print('-1')

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

ans = 13
while True:
    if int(ans*0.08)==a and int(ans*0.1)==b:
        print(ans)
        break
    else:
        ans += 1
        if ans > 1262:
            print(-1)
            break

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
def cal():
    for i in range(1,1010):
        at=int(i*0.08)
        bt=int(i*0.1)
        if at == a and bt == b:
            return i
    return -1
print(cal())

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    a,b = map(int,input().strip().split())
    # 100*a//8 <= x < 100*(a+1)//8
    # range(100*a//8,100*(a+1)//8)
    x=100*a//8
    while True:
        if 100*b <= 10*x < 100*(b+1) and 100*a <= 8*x < 100*(a+1):
            print(x)
            return
        if 10*x > 100*(b+1) and 8*x > 100*(a+1):
            print(-1)
            return
        x+=1
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import *
A,B = map(int,input().split())
#A,B = 1,1

#原価を推定
a = ceil(12.5*A)
b = ceil(10*B)

#print(a)
#print(b)

if A%2==0:
    if (a+12 < b) or (b+9 < a):
        print(-1)
    else:
        if a==b:
            print(a)
        elif a > b:
            print(a)
        else:
            print(b)
            
else:
    if (a+11 < b) or (b+9 < a):
        print(-1)
    else:
        if a==b:
            print(a)
        elif a > b:
            print(a)
        else:
            print(b)

Submission status: Accepted

Solution code:
a,b=input().strip().split(" ")
a,b=[int(a),int(b)]
k=0
for i in range(1200):
    aa=(i*8)//100
    bb=(i*10)//100
    if (a==aa and b==bb):
        print(i)
        k=1
        break
if k==0:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int,input().split())
ans = []
for i in range(1001):
    price_8 = math.floor(i * 0.08)
    price_10 = math.floor(i * 0.1)
    if price_8 == a and price_10 == b:
        ans.append(i)

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

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())

ans = -1
for i in range(1, 1011):
    ai = math.floor(i * 1.08)
    bi = math.floor(i * 1.10)
    if ai == i + a and bi == i + b:
        ans = i
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  a,b=map(int,input().split())
  for i in range(1010):
    if int(i*0.08)==a and i//10==b:
      print(i)
      return
  print(-1)
main()

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
ans = -1
for i in range(1001) :
  a1 = int(i*0.08)
  b1 = int(i*0.1)
  if a1 == a and b1 == b :
    ans = i
    break
print(ans)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

ans = -1
for i in range(1001):
    a = int(i*0.08)
    b = int(i*0.1)
    if a == A and b == B:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
for i in range(10001):
    if math.floor(i*0.08) == A and math.floor(i*0.1) == B:
        print(i)
        break
    if i == 10000:
        print(-1)

Submission status: Accepted

Solution code:
import math
from sys import stdin


def get_result(data):
    A, B = data
    min_A, max_A = math.ceil(A / 0.08), math.floor((A+1) / 0.08)
    min_B, max_B = math.ceil(B / 0.10), math.floor((B+1) / 0.10)

    tmp_A = [i for i in range(min_A, max_A)]
    tmp_B = [i for i in range(min_B, max_B)]
    ans = list(set(tmp_A) & set(tmp_B))
    if len(ans) == 0:
        return -1

    return min(ans)


if __name__ == '__main__':
    data = list(map(int, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans=max((A*100-1)//8+1,B*10)
if ans>=min((((A+1)*100)-1)//8+1,(B+1)*10):
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
import math

a, b = map(int, input().split())
ans = float('inf')

for i in range(1, 1001):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        if ans > i:
            ans = i

if ans == float('inf'):
    print(-1)
else:
    print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split());v=max(A*25+1>>1,B*10);print(v if v<min(A*25+26>>1,B*10+10)else-1)

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]

ans = -1
for i in range(1, 10100):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=min(25*a/2,10*b)
if 25*a/2>=10*(b+1) or 25*(a+1)/2<=10*b:
  print(-1)
else:
  while x<max(25*a/2,10*b):
    x=x+1
  print(int(x))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
flag = False
for x in range(1, 1001):
    if int(x * 0.08) == a:
        if int(x * 0.1) == b:
            print(x)
            flag = True
            break
if flag == False:
    print(-1)

Submission status: Accepted

Solution code:
import sys, math

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

for i in range(1, 10101):
  if math.floor(i * 0.08) == A:
    if math.floor(i * 0.1) == B:
      print(i)
      sys.exit()

print(-1)

Submission status: Accepted

Solution code:
import math
a,b = map(int ,input().split())
for i in range(1,10**5):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if b*10 <= a*100/8 < (b+1)*10:
    if int(a*100/8) == a*100/8:
        print(int(a*100/8))
    else:
        print(int(a*100/8)+1)
else:
    if a*100/8 <= b*10 < (a+1)*100/8:
        print(b*10)
    else:
        print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

ret = -1
for i in range(1,1500):
	tax_A = int(i * 0.08)
	tax_B = int(i * 0.10)
	if tax_A == A and tax_B == B:
		ret = i
		break

print(ret)

Submission status: Accepted

Solution code:
import math
import sys

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

for i in range(1001):
    if math.floor(i*0.08)==A:
        if math.floor(i*0.1)==B:
            print(i)
            sys.exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
import math
readline = sys.stdin.readline
a, b = [int(x) for x in readline().strip().split(" ")]
ans = -1
for i in range(13, 1001):
    if a == math.floor(i * 0.08) and b == math.floor(i * 0.1):
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))
a_min = -(-a // 0.08)
a_max = (a + 1) // 0.08
b_min = -(-b // 0.1)
b_max = (b + 1) // 0.1
if(a_max < b_min or b_max < a_min):
    print(-1)
elif(a_min <= b_min):
    print(int(b_min))
elif(b_min <= a_min):
    print(int(a_min))

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
c = 0
for i in range(math.ceil(A/0.08),math.floor((A+0.99)/0.08)+1):
    if c == 1:
        break
    for j in range(math.ceil(B/0.1),math.floor((B+0.99)/0.1)+1):
        if i == j:
            print(i)
            c = 1
            break
if c == 0:
    print(-1)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
for i in range(10000):
    if i*0.08//1==A and i*0.1//1==B:
        print(i)
        exit(0)
print("-1")

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for x in range(10 * B, 10 * B + 10):
    if 12.5 * A <= x < 12.5 * A + 12.5:
        print(x)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans=-1
for i in range(1,1010):
  if int(i*0.08)==a and int(i*0.1)==b:
    ans=i
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
n = int(A/0.08)
while n < (A+1)/0.08 and n < (B+1)/0.1:
  if n >= A/0.08 and n >= B/0.1:
    print(n)
    break
  n += 1
else:
  print(-1)

Submission status: Accepted

Solution code:
a, b = [int(elem) for elem in input().split()]

flg = 0
for i in range(1, 1009):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    print(i)
    flg = 1
    break
if flg == 0:
  print(-1)

Submission status: Accepted

Solution code:
import math

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

A1 = A * 12.5
A2 = (A + 0.9) * 12.5
B1 = B * 10
B2 = (B + 0.9) * 10

if B1 <= A1 and A1 < (B + 1) * 10:
    print(math.ceil(A1))
elif A1 <= B1 and B1 < (A + 1) *12.5 :
    print(B1)
else:
    print(-1)

Submission status: Accepted

Solution code:
# input
A,B = map(int, input().split())
# calculate
price = -1
for n in range(10000):
  if int(n * 0.08) == A and int(n * 0.1) == B:
    price = n
    break
  else:
    pass
# output
print(price)

Submission status: Accepted

Solution code:
a, b = map(int, input().strip().split())


def check(p):
    return int(p * 0.08) == a and int(p * 0.10) == b


def check_all():
    for p in range(10001):
        if check(p):
            return p

    return -1


ans = check_all()
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a, b = map(int,input().split())
min = math.floor(a / 0.08)
max = math.ceil((a+1)/0.08)
ans = 0
for i in range(min, max):
    if math.floor(i * 0.08) == a and math.floor(i*0.1) == b:
        ans = i
        break
if ans == 0:
    print("-1")
else:
    print(ans)

Submission status: Accepted

Solution code:
import math
A, B = map(int, input().split())
# [0.08x] = A so A <= 0.08x < A+1
# Thus, A/0.08 <= x < A+1
# For the first condition, mix(x) = ceil(A/0.08) and max(x) = ceil((A+1)/0.08)-1

min_A = math.ceil(A/0.08)
max_A = math.ceil((A+1)/0.08) - 1

min_B = math.ceil(B/0.1)
max_B = math.ceil((B+1)/0.1) - 1

if min(max_A, max_B) < max(min_A, min_B):
  print('-1')
else:
  print(max(min_A, min_B))

Submission status: Accepted

Solution code:
A, B =map(int, input().split())
max_A=(A+1)*25/2
max_B=10*(B+1)
p=int(round(max([A*12.5,B*10])+0.4999999999,0))
print(p if(p<min([(A+1)*25/2, 10*(B+1)]) and not(4<5*A-4*B) and not(5*A-4*B<-5)) else -1)

Submission status: Accepted

Solution code:
ret = "-1"

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

for i in range(1,2000):
    if int(i*0.08) == A and int(i * 0.1) == B:
        ret = str(i)
        break

print(ret)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(100000):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())

for i in range (1251):
  if (int(i*0.08)==a) and (int(i/10)==b):
    print(i)
    exit()

print(-1)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans = -1
for n in range(1,10000):
    if (n*8//100) == A and (n*10//100) == B:
        ans = n
        break
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())

def tax(A,B):
    count=0
    x=B/0.1
    if int(x*0.08)>A:
        return '-1'
    y=int(x*0.08)
    while True:
        if y<A:
            count+=1
            x+=1
            y=int(x*0.08)
        else:
            if count>9:
                return '-1'
            else:
                return int(x)
            break

print(tax(A,B))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
_MAX_PRICE = 1001
for n in range(1, _MAX_PRICE):
  if int(n * 0.08) == A and int(n * 0.1) == B:
    print(n)
    exit()
print(-1)

Submission status: Accepted

Solution code:
import sys
A,B = list(map(int,input().split()))

M = 1009
for n in range(1,M):
  if (int(n*0.08) == A) and (int(n*0.1) == B):
    print(int(n))
    sys.exit()

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
v = round(a*12.5+0.1)
w = round(a*12.5+11.6)
x = int(b*10)
y = int(b*10+9)
if(max(v,x) <= min(w,y)):
    print(max(v,x))
else:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b = map(int, input().split())
for i in range(1,1200):
    if math.floor(i * 0.08) == a and math.floor(i*0.1) == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

Solution code:
import math

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

p = -1
b = int(B / 0.1)

for i in range(10):
    n = math.floor((b+i) * 0.08)
    if n == A:
        p = b+i
        break

print(p)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
def func():
    for ans in range(2000):
        if int(ans * 0.08) == A and int(ans * 0.1) == B:
            return ans
    return -1
print(func())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

ans = -1
for i in range(10000):
    if int(i * 0.08) == A  and int(i * 0.1) == B:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

for i in range(1, 10000):
    if (i * 8) // 100 == a and (i * 10) // 100 == b:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys
a,b=map(int,sys.stdin.readline().split())

left=1
right=1009
for i in range(1,1010):
    if int(0.08*i)==a and int(0.1*i)==b:
        print(i)
        sys.exit()

print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = -1
for i in range(10001):
  if (A/0.08 <= i < (A+1)/0.08) and (B/0.1 <= i < (B+1)/0.1):
    ans = i
    break
    
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

for i in range(10000):
    if int(i * 0.08) == a and int(i * 0.1) == b:
        print(i)
        exit(0)

else :
        print(-1)

Submission status: Accepted

Solution code:
import math
A,B = map(int,input().split())
Acand = []
for i in range(math.ceil(A*(100/8)),math.floor((A+1)*(100/8))):
  Acand.append(i)
Bcand = []
for i in range(math.ceil(B*10),math.floor((B+1)*10)):
  Bcand.append(i)
doub = list(set(Acand) & set(Bcand))
doub.sort()
if len(doub) == 0:
  print(-1)
else:
  print(doub[0])

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
flg=0

for i in range(1200):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i)
        flg=1
        break

if flg==0:
    print(-1)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())

N=[i for i in range(int(-(-A//0.08)),int(-(-(A+1)//0.08)))]
M=[i for i in range(int(-(-B//0.1)),int(-(-(B+1)//0.1)))]

if N[0] in M:
    print(int(-(-A//0.08)))
elif M[0] in N:
    print(int(-(-B//0.1)))
else:
    print(-1)

Submission status: Accepted

Solution code:
import sys
import math

f = sys.stdin.readline()
xx = f.split(' ')
x = [int(str) for str in xx]

a = x[0]
aa = a+1
b = x[1]
bb = b+1


x = int(a / 0.08)
xx = int(aa / 0.08)
y = int(b / 0.1)
yy = int(bb / 0.1)


if ( x > y ):
	min = x
	if( x * 0.08 < a):
		min = x + 1
	if( min >= yy):
		print "-1"
	else:
		print min
else:
	min = y
	if( min >= xx):
		print "-1"
	else:
		print min

sys.stdout.flush()

Submission status: Accepted

Solution code:
#C
AB = input().split(' ')
A = int(AB[0]) ; B = int(AB[1])
ans = []
for x in range(1,10*(B + 1)):
    p = x * 0.1 - B
    q = x * 0.08 - A
    if (p >= 0) and (p < 1) and (q >= 0) and (q < 1):
        ans.append(x)
        break
if len(ans) == 0:
    print(-1)
else:
    print(ans[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

for p in range(10**4):
    tax8 = p*0.08
    tax10 = p*0.1

    if int(tax8)==a and int(tax10)==b:
        print(p)
        exit()

print(-1)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
j = -1
for t in range(1, 1010):
    if int(t*0.08) == a and int(t*0.1) == b:
        j = t
        break

print(j)

Submission status: Accepted

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