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:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from functools import reduce, lru_cache
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIR1(n): return [LI1() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    A, B = LI()

    for i in range(1, 2000):
        if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
            print(i)
            break
    else:
        print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

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

for n in range(2000):
    if int(n * 0.08) == A and int(n * 0.1) == B:
        print(n)
        break
else:
    print(-1)

Submission status: Accepted

Solution code:

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

lb_a = int(-(-A // 0.08))
ub_a = int(-(-(A + 1) // 0.08) - 1)

lb_b = int(-(-B // 0.1))
ub_b = int(-(-(B + 1) // 0.1) - 1)

if ub_b < lb_a or ub_a < lb_b:
    print(-1)
else:
    print(max(lb_a, lb_b))

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc158/tasks/abc158_c
import math
e,t = map(int,input().split())
t_s = list(range(math.ceil(t/0.1),math.ceil(t/0.1)+10))
ans = -1
for i in t_s:
    if math.floor(i*0.08) == e:
        ans = i
        break

print(ans)

Submission status: Accepted

Solution code:
import math

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

for i in range(10, 2000):
    a = math.floor(i * 0.08)
    b = math.floor(i * 0.1)
    if a == A and b == B:
        print(i)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools

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

if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:


A,B = list(map(int, input().split()))
ans = 10e7
is_true = False
for i in range(1,1010):
    a = int(i*0.08)
    b = int(i*0.10)
    if a == A and b == B:
        ans = min(ans, i)
        is_true = True
if is_true:
    print(ans)
else:
    print(-1)

Submission status: Accepted

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

for i in range(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 = map(int,input().split())
tmp = 0
for i in range(10001):
    if int(i * 0.08) == a and int(i * 0.10) == b:
        tmp = 1
        break
if tmp == 1:
    print(i)
else:
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    A, B = map(int, input().split())

    for i in range(0, 100000):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            print(i)
            return

    print(-1)


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=max(int(100*a/8),10*b)
d=min(int(100*a/8+100/8),10*b+10)
f=0
for x in range(c,d+1):
    if f==0 and int(x*0.08)==a and int(x*0.1)==b:
        f=1
        print(x)
if f==0:
    print(-1)

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
ans=[]
for i in range(1251):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==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())

flg = False
for i in range(0, 1011):
    x = math.floor(0.08 * i)
    y = math.floor(0.10 * i)
    if x == a and y == b:
        flg = True
        break
print(i) if flg else print(-1)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
dic1 = [0 for _ in range(10**3+1)]
dic2 = [0 for _ in range(10**3+1)]

for i in range(1,10**3+1):
    tax = i * 0.08
    tax2 = i * 0.1
    dic1[i] = int(tax)
    dic2[i] = int(tax2)

for i in range(10**3+1):
    if dic1[i] == a and dic2[i] == b:
        print(i)
        exit()
print(-1)

Submission status: Accepted

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

for i in range(1010):
    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())
flag = True
res = 0
for i in range(2000):
  n8 = int(i * 0.08)
  n10 = int(i* 0.1)
  if n8 == A and n10 == B:
    flag = False
    res = i
    break
  elif n10 == A and n8 == B:
    flag=False
    res = i
    break
  else:
    pass
if flag:
  print(-1)
else:
  print(res)

Submission status: Accepted

Solution code:
# ABC158 C - Tax Increase
a,b = map(int,input().split())
import math
c=10000
for i in range(1200):
    if math.floor(i*0.08)==a and math.floor(i*0.10)==b:
        c = min(c,i)
if c==10000:
    print(-1)
    exit()
print(c)

Submission status: Accepted

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

for i in range(1,10000):
    aa = ( i * 8 ) // 100
    bb = ( i * 10 ) // 100
    if aa == a and bb == b:
        print(i)
        exit()
print("-1")

Submission status: Accepted

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

S = B * 10
ans = -1

while S < (B+1) * 10:
    if int(S*0.08) == A:
        if ans != -1:
            ans = min(ans, S)
        else:
            ans = S
    S += 1

print(ans)

Submission status: Accepted

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

ans = -1

for i in range(13, 1001):
  if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B :
    ans = i
    break

print(ans)

Submission status: Accepted

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

def main(a,b):
    for i in range(20000):
        if i*108//100 - i ==a and i*110//100 - i ==b:
            return i
    return -1

if __name__=='__main__':
    a,b=readinput()
    ans=main(a,b)
    print(ans)

Submission status: Accepted

Solution code:
# C Tax Increase

from math import ceil

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

a = [i for i in range(ceil(A*100/8), int((A+1)*100/8))]
b = [i for i in range(B*10, (B+1)*10)]

ans = list(set(a) & set(b))
if ans:
  print(min(ans))
else:
  print(-1)

Submission status: Accepted

Solution code:
def tax_increase():
    """
    消費税率 8% → 消費税 A円
    消費税率 10% → 消費税 B円
    商品価格 X = A / 0.08  → 25A / 2
        　　 X = B / 0.1   → 10B
    消費税は切り捨てなので、消費税の範囲は
    A <= X < A+1
    """
    # 入力
    A, B = map(int, input().split())
    # 初期処理
    tax_excluded_price_list1 = list()
    tax_excluded_price_list2 = list()
    # 消費税率 8%
    tax_excluded_price_low1 = 25 * A / 2 # 税抜き価格1
    tax_excluded_price_low2 = int(tax_excluded_price_low1) # 小数点以下切り捨て1
    tax_excluded_price_high1 = 25 * (A+1) / 2 # 税抜き価格2
    tax_excluded_price_high2 = int(tax_excluded_price_high1) # 小数点以下切り捨て2
    # 税抜き価格の取り得る範囲 
    for i in range(tax_excluded_price_low2, tax_excluded_price_high2+1):
        if tax_excluded_price_low1 <= i and i < tax_excluded_price_high1:
            tax_excluded_price_list1.append(i)
    # 消費税率 10%
    tax_excluded_price_low1 = 10 * B # 税抜き価格1
    tax_excluded_price_low2 = int(tax_excluded_price_low1) # 小数点以下切り捨て1
    tax_excluded_price_high1 = 10 * (B+1) # 税抜き価格2
    tax_excluded_price_high2 = int(tax_excluded_price_high1) # 小数点以下切り捨て2
    # 税抜き価格の取り得る範囲 
    for i in range(tax_excluded_price_low2, tax_excluded_price_high2+1):
        if tax_excluded_price_low1 <= i and i < tax_excluded_price_high1:
            tax_excluded_price_list2.append(i)
    # 最も小さい金額で条件を満たすもの
    for i in tax_excluded_price_list1:
        if i in tax_excluded_price_list2:
            return i
    # 条件を満たす税抜き価格がない場合
    return '-1'
    
result = tax_increase()
print(result)

Submission status: Accepted

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

a = [i for i in range(int((A-1)*100/8 ), int((A+1)*100/8 ))]
b = [i for i in range(int((B-1)*100/10), int((B+1)*100/10))]

a = [i for i in a if int(i*0.08) == A]
b = [i for i in b if int(i*0.10) == B]

ans = list(set(a) & set(b))
if ans and min(ans) > 0:
    print(min(ans))
else:
    print(-1)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7

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

big = 100000
ans = big + 1
for i in range(big, 0, -1):
    if int(i*0.08) == a and int(i*0.1) == b:
        ans = i
    
if ans <= big:
    print(ans) 
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

cand = [i for i in range(1, 1001)]
res = []
flg = False
for i in cand:
  if int(i * 0.08) == A and int(i * 0.10) == B:
    res.append(i)
    flg = True

if flg:
  print(res[0])
else:
  print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
a_list = []
b_list = []
flag = 0

for i in range(1,1009):
    if int(i*1.08)-i == a:
        a_list.append(i)

for j in a_list:
    if int(j*1.1)-j == b:
        print(j)
        flag = 1
        break

if flag != 1:
    print('-1')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(A: int, B: int):
    for i in range(1000 + 1):
        if int(i * 0.08) == A and int(i * 0.1) == B:
            return i
    return -1


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    print(f'{solve(A, B)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = -1
for i in range(1, 1251):
    if i * 8 // 100 == A and i * 10 // 100 == B:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math
import sys

A, B = list(map(int, input().split()))
for i in range(1001):
  priceA = math.floor(i*1.08)
  priceB = math.floor(i*1.10)
  taxA = priceA - i 
  taxB = priceB - i 
  if taxA == A and taxB == B:
    print(i)
    sys.exit()
print("-1")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc158_c.py
# https://atcoder.jp/contests/abc158/tasks/abc158_c

# C - Tax Increase /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 300点

# 問題文
# 消費税率が 8%のとき A 円、10 ％のとき B円の消費税が課されるような商品の税抜き価格を求めてください。
# ただし、税抜き価格は正の整数でなければならないものとし、消費税の計算において小数点以下は切り捨てて計算するものとします。
# 条件を満たす税抜き価格が複数存在する場合は最も小さい金額を出力してください。
# また、条件を満たす税抜き価格が存在しない場合は -1 と出力してください。

# 制約
#     1≤A≤B≤100
#     A,Bは整数である

# 入力
# 入力は以下の形式で標準入力から与えられる。
# A B

# 出力
# 条件を満たす税抜き価格が存在する場合は最小の金額を表す整数を、存在しない場合は -1 を出力せよ。

# 入力例 1
# 2 2

# 出力例 1
# 25

# 税抜き価格が 25円の場合、消費税率が 8%のとき消費税は ⌊25×0.08⌋=⌊2⌋=2円です。
# 消費税率が 10%のとき消費税は ⌊25×0.1⌋=⌊2.5⌋=2円です。
# よって 25円は条件を満たし、また 26 円のときなども条件を満たしますが、これが最小であるので 25を出力してください。

# 入力例 2
# 8 10

# 出力例 2
# 100

# 税抜き価格が 100円の場合、消費税率が 8%のとき消費税は ⌊100×0.08⌋=8円です。
# 消費税率が 10%のとき消費税は ⌊100×0.1⌋=10円です。

# 入力例 3
# 19 99

# 出力例 3
# -1

# 条件を満たす税抜き価格は存在しないので、-1 を出力してください。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    A, B = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    for n in range(1020):
        a = int(n * 0.08)
        b = int(n * 0.1)
        if a == A and b == B:
            return [n]

    return [-1]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2 2']
        lines_export = [25]
    if pattern == 2:
        lines_input = ['8 10']
        lines_export = [100]
    if pattern == 3:
        lines_input = ['19 99']
        lines_export = [-1]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if int(a / 0.08 * 0.1) == b:
    print(round(a / 0.08 + 0.0001))
elif int(b / 0.1 * 0.08) == a:
    print(round(b / 0.1 + 0.0001))
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = 1000
p1 = 0.08
p2 = 0.1

for i in range(1, N + 1):
    if int(i * p1) == A and int(i * p2) == B:
        print(i)
        exit()

print("-1")

Submission status: Accepted

Solution code:
from sys import stdin
input = stdin.readline


def main():
  A, B = list(map(int, input().split()))

  for i in range(10000):
    if int(i * 0.08) == A and \
       int(i * 0.10) == B:

      print(i)
      return
  print(-1)


if(__name__ == '__main__'):
  main()

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

a,b = I()
for i in range(1,2000):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        sys.exit()

print(-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math
from functools import reduce

a,b = [int(x) for x in stdin.readline().rstrip().split()]

c = int(b*10)

for i in range(10):
    if a == int(c*0.08):
        print(c)
        sys.exit()
    c = c + 1

print(-1)

Submission status: Accepted

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

A, B = map(int, input().split())
x = 25 * A // 2

for x in range(B * 10 + 0, B * 10 + 10, 1):
  if round(x * 8 // 100) == A:
    print(x)
    exit()
print('-1')

Submission status: Accepted

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

min_ans = int((12.5*A) // 1)
max_ans = int(-((-12.5*(A+1)) // 1))

ans = -1
for i in range(min_ans,max_ans):
  temp_A = (i*0.08)//1
  temp_B = (i*0.1)//1
  if temp_A == A and temp_B == B :
    ans = i
    break
  
print(ans)

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:
from math import floor


def main():
    a, b = map(int, input().split())
    for yen in range(1, 1100):
        if floor(yen * 0.08) == a and floor(yen * 0.1) == b:
            print(yen)
            return
    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#57
import decimal
a,b = map(int,input().split())

for i in range(1,10001):
    num1 = int(i*decimal.Decimal("0.08"))
    num2 = int(i*decimal.Decimal("0.1"))
    if num1 == a and num2 == b:
        print(i)
        break
    if int(i*decimal.Decimal("0.08")) > a:
        print("-1")
        break

Submission status: Accepted

Solution code:
import sys


def solve(a, b):
    for i in range(1, 10000):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            return i
    return -1


def main():
    input = sys.stdin.buffer.readline
    a, b = map(int, input().split())
    print(solve(a, b))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
N,M = map(int,input().split())
n = math.ceil(N/0.08)
m = int(M/0.1)
ans = 2000
if int(n*0.1) ==M:
  ans = min(n,ans)
if int(m*0.08) ==N:
  ans =min(m,ans)
  
if int(n*0.1)!=M and int(m*0.08)!=N:
  ans = -1
  
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
raw_b = b*10
for i in range(raw_b, raw_b+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(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 x in range(1,1001):
  if A==int(x*0.08) and B==int(x*0.1):
    print(x)
    break
  elif x==1000:
    print(-1)

Submission status: Accepted

Solution code:
import math
a, b = map(int, input().split())
for i in range(1, 1010):
    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())
q = list()
for i in range(1009):
  if int(i*0.08) == a and int(i*0.1) == b:
    q.append(i)

if len(q) == 0:
  print(-1)
  exit()
print(min(q))

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
num=1
while 1:
    if int(num*0.08)==a and int(num*0.1)==b:
        print(num)
        break
    if int(num*0.08)>a and int(num*0.1)>b:
        print(-1)
        break
    num+=1

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
c=[]
d=[]
if int(A*100/8)==A*100/8:
  i=int(A*100/8)
else:
  i=int(A*100/8+1)
while i<(A+1)*100/8:
  c.append(i)
  i+=1
if int(B*100/10)==B*100/10:
  j=int(B*100/10)
else:
  j=int(B*100/10+1)
while j<(B+1)*100/10:
  d.append(j)
  j+=1
if min(c[len(c)-1],d[len(d)-1])<max(c[0],d[0]):
  print(-1)
else:
  print(max(c[0],d[0]))

Submission status: Accepted

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

taxfree = 1

while True:
    if int(taxfree*0.08)==a and int(taxfree*0.1)==b:
        break
    taxfree += 1
    if taxfree == 1001:
        taxfree = -1
        break

print(taxfree)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
for i in range(1,1251):
    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())

genka_8_min=a*12.5
genka_8_max=(a+1)*12.5

if not genka_8_min.is_integer():
    genka_8_min=int(genka_8_min+1)

if genka_8_max.is_integer():
    genka_8=list(range(int(genka_8_min),int(genka_8_max)))
else:
    genka_8=list(range(int(genka_8_min),int(genka_8_max)+1))

genka_10_min=b*10
genka_10_max=(b+1)*10
genka_10=list(range(int(genka_10_min),int(genka_10_max)))

ans=set(genka_8)&set(genka_10)

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

Submission status: Accepted

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

for x in range(10**3+1):
    if int(x * 0.08) == A and int(x * 0.1) == B:
        print(x)
        exit()

print(-1)

Submission status: Accepted

Solution code:
import math

a, b = list(map(int, input().split()))
n = b * 10
flag = False
while n <= 1009:
    if math.floor(n * 0.1) == b and math.floor(n * 0.08) == a:
        flag = True
        break
    n += 1
print(n) if flag is True else print(-1)

Submission status: Accepted

Solution code:
a,b=map(int,input().split());r=[i for i in range(1,1010) if i*0.08//1==a and i*0.1//1==b];print(r[0] if r else -1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split())
count=1
while True:
  c=count*0.08
  d=count*0.1
  if math.floor(c)==a and math.floor(d)==b:
    print(count)
    break
  count+=1
  if count>1500:
    print(-1)
    break

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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


def floor_inv(x, f):
    res = int(x / f)
    if int(res * f) < x:
        res += 1
    return res


lb1 = floor_inv(A, 0.08)
ub1 = floor_inv(A + 1, 0.08)

lb2 = floor_inv(B, 0.10)
ub2 = floor_inv(B + 1, 0.10)

if ub1 <= lb2 or ub2 <= lb1:
    print(-1)
else:
    print(max(lb1, lb2))

Submission status: Accepted

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

for p in range(1, 10000):
    if p * 8 // 100 == A and p // 10 == B:
        print(p)
        break
else:
    print(-1)

Submission status: Accepted

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

flag = False

for a in range(12, 1263):
    if flag:
        break
    for b in range(10, 1001):
        a_tax = int(a * 0.08)
        b_tax = int(b * 0.10)
        if(a_tax == A and b_tax == B and a == b):
            print(a)
            flag = True
            
else:
    print(-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import collections as cl
import math

def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def main():
    A,B = MI()
    for i in range(11000):
        if math.floor( i * 0.08 ) == A and math.floor(i * 0.1) == B:
            print(i)
            exit()

    print(-1)


main()

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10**4):
    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 = list(map(int,input().split()))
p = a[0]
q = a[1]
for i in range(2000):
  if int(i*0.08) == p and int(i*0.1) == q:
    print(i)
    break
  if i == 1999:
    print(-1)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
for k in range(1001):
  if int(ans*0.08) == A and int(ans*0.1) ==B:
    print(ans)
    exit()
  else:
    ans += 1
print(-1)

Submission status: Accepted

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

Submission status: Accepted

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

ans = -1
for i in range(13,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())

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

Submission status: Accepted

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

ans = -1

for i in range(1,10100):
  if i // 12.5== a and i // 10 == b:
    ans = i
    break

print(ans)

Submission status: Accepted

Solution code:
import math
A,B=map(int,input().split())
eight=[]
i=0
ten=[]
for a in range(1,1001):
    if math.floor(a*0.08)==A:
        eight.append(a)
    if math.floor(a*0.1)==B:
        ten.append(a)

for a in eight:
    if a in ten:
        print(a)
        i=1
        break
if i==0:
    print("-1")

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
'''
floor(x * 1.08) = a -> x = a/1.08
floor(x * 1.10) = b -> x = b/1.10
少数や切り捨てがめんどくさい・・・全探索か
'''
ans = -1
for n in range(10000):
    if n * 8 // 100 == a and n * 10 // 100 == b:
        ans = n
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor as fl

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

for i in range(10000):
    if fl(i * 8 / 100) == A and fl(i / 10) == B:
        print(i)
        break
else:
    print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
ans = -1
for i in range(1, 1009):
    if int(i*0.08) == A and int(i*0.10) == B:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int, open(0).read().split())

i = int(a/0.08-1e-8)
while 1:
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        break
    if int(i*0.08)>a:
        print(-1)
        break
    i += 1

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
for price in range(0,1010) :
    if int(price*0.08) == a and int(price*0.10) == b :
        print(price)
        break
else :
    print("-1")

Submission status: Accepted

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

solve()

Submission status: Accepted

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