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: Wrong Answer

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

x1=-(-a//0.08)
x2=-(-(a+1)//0.08)-1
y1=-(-b//0.10)
y2=-(-(b+1)//0.10)-1
print(x1,x2,y1,y2)
if x1<=y1 and y1<=x2:
    print(int(y1))

elif y1<=x1 and x1<=y2:
    print(int(x1))


else:
    print(-1)

Submission status: Wrong Answer

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

beforeA = range(int(a * (100 / 8)), int((a+1) * (100 / 8)))
beforeB = range(b * 10, (b+1) * 10)
ans = 999
flag = False
for i in beforeA :
    for j in beforeB :
        #print(i, j)
        if i == j :
            flag = True
            ans = min(ans, i)
if flag :
    print(ans)
else :
    print(-1)


#print(beforeA, beforeB)

Submission status: Wrong Answer

Solution code:
import math

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

p_A = math.floor((A+1) * 100 / 8)
n_A = math.ceil(A * 100 / 8)
p_B = math.floor((B+1) * 100 / 10)
n_B = math.ceil(B * 100 / 10)

if n_A > p_B or n_B > p_A:
    print('-1')
else:
    print(max(n_A, n_B))

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 157: C (2020/03/07)
A, B = map(int, input().split())
X = int(A/0.08)
if int(X*0.1) == B:
    print(X)
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

A, B = map(int, input().split())
tmpa =  math.floor(A / 0.08)
tmpb = math.floor(B / 0.1)
alst = []
blst = []

indexa = 0
while True:
    tmp = math.floor((tmpa + indexa) * 0.08)
    if tmp == A:
        alst.append(tmpa + indexa)
        indexa += 1
    else:
        break
indexb = 0
while True:
    tmp = math.floor((tmpb + indexb) * 0.1)
    if tmp == B:
        blst.append(tmpb + indexb)
        indexb += 1
    else:
        break
ans = -1
alst.sort()
blst.sort()
for i in alst:
    if blst.count(i) >= 1:
        ans = i
        break

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
a_origin = int(a*100/8)
b_origin = int(b*10)

while True:
    if a_origin == b_origin:
        result = a_origin
        break;
    if a_origin < b_origin:
        a_origin += 1
    else:
        b_origin += 1

    if a_origin > (a+1) * 100/8 or b_origin > (b+1) * 10:
        result = -1
        break

print(result)

Submission status: Wrong Answer

Solution code:
import math

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

for i in range(101):
  if(math.floor(i*0.08) == A and math.floor(i*0.10) == B and flag == True):
    print(i)
    flag=False

if(flag==True):
  print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0

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

Submission status: Wrong Answer

Solution code:
import math
def ccc(a, b):

    aaa = a * 12 + (a / 2)

    bbb = math.floor(aaa * 0.1)

    if b == bbb:
        return aaa
    else:
        return "-1"

    return 
def main():
    a , b = map(int , input().split())
    print(ccc(a , b))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
import math as m

def main(**kwargs):
    if len(range(max(int(a / 0.08), int(b / 0.1)), min(int((a + 1) / 0.08), int((b + 1) / 0.1)))) > 0:
        res = max(int(a / 0.08), int(b / 0.1))
        
    else:
        res = -1

    return res

if __name__ == "__main__":
    cin = np.array(input().split(" ")).astype("int")
    a, b, *_ = cin

    cout = main(a=a, b=b)
    print(cout)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
def main():
    A,B = map(int,input().split())
    ansA = math.floor(A/0.08)
    if math.floor(0.1*ansA) == B:
        print(ansA)
        return
    print('-1') 


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

input_line = [int(i) for i in input().split()]
a = input_line[0]
b = input_line[1]

big = math.floor(a / 0.08)
small = math.ceil(b / 0.1)

ans = -1
for i in range(small, big+1):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
    else:
        continue
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
## Problem C
import math
a, b = map(int, input().split())
c = ((a * 25) // 2)
for i in range(c, c+2):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        print(i)
        exit()
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


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


def main():
    A, B = map(int, input().split())
    if A > B:
        print(-1)
        exit()
    if A / 0.08 < B / 0.1:
        print(-1)
        exit()
    for n in range(int(A / 0.08)-10, 10 * B + 10):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            print(n)
            exit()
    print(-1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def calc_list(X, z):
  root = X * (100 / z)
  l = [root]
  while True:
    if int((root + 1) * (z / 100)) == X:
      l.append(root + 1)
      root += 1
    else: break

  while True:
    if int((root - 1) * (z / 100)) == X:
      l.append(root - 1)
      root -= 1
    else: break

  return set(l)

A, B = list(map(lambda x: int(x), input().split()))

# 8%でA円になる金額を求める
a = calc_list(A, 8)

# 10%でB円になる金額を求める
b = calc_list(B, 10)

# 一致しているものがあればその金額、なければ-1を出力する
c = a & b
if len(c) > 0:
  print(int(list(c)[0]))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
x1 = int(A * 100.0 / 8)
x2 = B * 10
y1 = int((A+1) * 100.0 / 8)
y2 = (B+1) * 10

r = -1
for p in range(max(x1,x2), min(y1,y2)):
    r = p
    break
print(r)

Submission status: Wrong Answer

Solution code:
import math

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

def rangeOfPriceWithoutTax(price, rate):
    min_ = math.ceil(price / rate)
    max_ = math.floor((price + 1) / rate)
    if min_ <= max_:
        return set(range(min_, max_ + 1))
    else:
        return set()

range_ = rangeOfPriceWithoutTax(A, 0.08) & rangeOfPriceWithoutTax(B, 0.1)

try:
    print(min(range_))
except ValueError:
    print(-1)

Submission status: Wrong Answer

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

A, B = map(int, input().split(' '))
x = A / 0.08
y = A / 0.1
ans = max(x, y)
if ans.is_integer():
    print(int(ans))
else:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()

# x = a * 0.92
# y = b / 0.90
# print(x, y)
x1 = a / 0.08
y1 = b /0.1
x2 = (a+1) / 0.08
y2 = (b+1) /0.1

if ceil(y1) <= ceil(x1) <= ceil(y2):
    ans = ceil(x1)
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

x_b = b * 10

x = int(x_b)

if int(x * 0.08) == a:
    print(x)
else:
    print(x + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

asub = int(a / 0.08)
bsub = int(b / 0.1)

s = math.floor(asub * 0.08)
ss = math.floor(asub * 0.1)

t = math.floor(bsub * 0.08)
tt = math.floor(bsub * 0.1)

if s == a and ss == b:
    print(asub)
elif t == a and tt == b:
    print(bsub)
else:
    print("-1")

Submission status: Wrong Answer

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

na = [int(a / 0.08), int((a+1) / 0.08)]
nb = [int(b / 0.1), int((b+1) / 0.1)]

if nb[1] < na[0] or na[1] < nb[0]:
    print(-1)
elif na[0] <= nb[0] and nb[0] <= na[1]:
    print(nb[0])
elif nb[0] <= na[0] and na[0] <= nb[1]:
    print(na[0])

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
pamin=int(a/0.08)
pamax=int((a+1)/0.08)-1
pbmin=int(b/0.1)
pbmax=int((b+1)/0.1)-1

if pbmin<=pamin<=pbmax or pbmin<=pamax<=pbmax:
  print(max(pamin,pbmin))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a,b = -a,-b
minA,minB = a // 0.08, b // 0.1
a,b = -a,-b
minA,minB = -minA,-minB
maxA,maxB = (a+1) // 0.08, (b+1) // 0.1
if minA > maxB or minB > maxA:
    print(-1)
else:
    print(int(minA))

Submission status: Wrong Answer

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

def main():
    a,b = map(int,input().split())
    ans = 0
    for i in range(10):
        for j in range(10):
            x = (a+i/10)/0.08
            y = (b+j/10)/0.1
            if x==y and x%1==0 and y%1==0:
                print(int(x))
                return
    print(-1)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
mi = lambda : map(int,input().split())

a,b = mi()

for i in range(1,102):
    if((int(i*0.08) == a) & (int((i*0.1)) == b)):
        print(i)
        break
else:
    print('-1')

Submission status: Wrong Answer

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

for i in range(1,100+1):
  if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
    print(i)
    exit()
print(-1)

Submission status: Wrong Answer

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

a1 = a/0.08
b1 = b/0.1

if((10*a1)%10 != 0):
    a1 = int(a/0.08)+1

if((10*b1)%10 != 0):
    b1 = int(b/0.08)+1

if(a1 < b1):
    print(-1)
    exit()

print(int(a1))

Submission status: Wrong Answer

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

a_value = int(A / 0.08)
b_value = int(B / 0.1)

if a_value == b_value:
    print(a_value)
elif a_value != b_value:
    if int(a_value * 0.08) == int(b_value * 0.1):
        if a_value > b_value:
            print(a_value)
        else:
            print(b_value)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A%2==0:
    set1={i for i in range((25*A)//2,(25*A+25)//2)}
    set2={i for i in range(10*B,10*B+10)}
    ans=set1.intersection(set2)
    if len(ans)>0:
        print(min(ans))
    else:
        print(-1)
else:
    set1={i for i in range((25*A)//2+1,(25*A+25)//2+1)}
    set2={i for i in range(10*B,10*B+10)}
    ans=set1.intersection(set2)
    if len(ans)>0:
        print(min(ans))
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
line = input().rstrip().split(' ')
a = int(line[0])
b = int(line[1])

ans = int(a / 0.08)
bans = int(b / 0.1)

if bans <= ans and ans < (b+1) / 0.1:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

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

x = -1

xa = 0
xb = 0

a_arr = []
b_arr = []

for temp_a in range(101):
    xa = temp_a * 0.08
    if xa // 1 == a:
        for temp_b in range(101):
            xb = temp_b * 0.1

            if xb // 1 == b:
                a_arr.append(temp_a)
                b_arr.append(temp_b)


for aa in a_arr:
    if aa in b_arr:
        print(aa)
        exit(0)

print('-1')

Submission status: Wrong Answer

Solution code:
#At coder 2020/3/8 C
import math

I = list(map(int, input().split())) 
A=I[0]
B=I[1]

a1=A/0.08
b1=B/0.1

a2=(A+1)/0.08
b2=(B+1)/0.1

af=math.ceil(a1)
ac=math.ceil(a2)
bf=math.ceil(b1)
bc=math.ceil(b2)

if ac<bf or bc<af:
    ans=-1
else:
    ans=min(af,bf)

print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())
a = A / 0.08
b = B / 0.1
ans = int(max(a, b))

aa = int((A+1) / 0.08)
bb = int((B+1) / 0.1)
if aa < b or bb < a:
    print("-1")
else:
    print(ans)

Submission status: Wrong Answer

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

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

ra = [floor(A, 0.08), int((A + 1) / 0.08)]
rb = [floor(B, 0.1), int((B + 1) / 0.1)]

if ra[1] < rb[0] or rb[1] < ra[0]:
    print(-1)
else:
    print(max(ra[0], rb[0]))

Submission status: Wrong Answer

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

xa = int(a/0.08)
if int(xa*0.1) == b:
    print(xa)
else:
    print('-1')

Submission status: Wrong Answer

Solution code:
import math
[a, b] = [int(i) for i in input().split()]
eight = math.floor(a / 8 * 100)
if b == math.floor(eight * 0.1):
    print(eight)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
def main():
  import sys
  import math
  input = sys.stdin.readline
  a,b=map(int,input().split())
  if b>=10:
    l=b*10
    if a==math.floor(l*0.08):
      print(l)
    else:
      print(-1)
  else:
    for i in range(b*10,b*10+10):
      if a==math.floor(i*0.08):
        print(i)
        exit()
    print(-1)
if __name__=='__main__':
  main()

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
L = []
for i in range(1000):
    if int(i*0.08) == A and int(i*0.1) == B:
        L.append(i)
        break
if len(L) == 1:
    print(L[0])
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,(input().split())))
temp_a = int(a/0.08)
temp_b = int(b/0.1)
ans = 0
#print(temp_a,temp_b)
for i in range(min(temp_a,temp_b),max(temp_b,temp_a)+1):
  if  int(i* 0.08) == int(i * 0.1) or temp_a == temp_b:
    ans = i
    break
    
if ans:
  print(ans)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a_min=math.ceil(A/0.08)
b_min=math.ceil(B/0.1)
a_list=[]
b_list=[]

for i in range(a_min,a_min+13):
  a_list.append(i)
for j in range(b_min,b_min+10):
  b_list.append(j)

ans=-1
for item in a_list:
  if item in b_list:
    ans=item
    break
  
print(ans)

Submission status: Wrong Answer

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

x_A_max = (A+1)/0.08
x_A_min = A/0.08

x_B_max = (B+1)/0.1
x_B_min = B/0.1

if (x_A_max<=x_B_min)or(x_A_min>=x_B_max):
    print(-1)
elif x_A_min<x_B_min:
    print(int(x_B_min))
else:
    print(int(x_A_min))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s

#main
A,B=map(int,input().split())
#n*0.08=A         n*0.1=B
#n=A/0.08 n=B/0.1
c=[int(A/0.08),int((A+1)/0.08)-1]
d=[int(B/0.1),int((B+1)/0.1)-1]
for a in range(min(c[0],d[0]),max(c[1],d[1])+1):
    if c[0]<=a and a<=c[1] and d[0]<=a and a<=d[1]:
        print(a)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

for i in range(25, 32):
  print(25 * 0.08)

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

Submission status: Wrong Answer

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

def solve(A: int, B: int):
    ten = B * 10
    ans = int(ten)

    while True:
        if math.floor(ans * 8 / 100) == A:
            print(ans)
            return
        elif math.floor(ans / 10) != B :
            print(-1)
            return
        ans += 1

def main():
    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
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


solve()

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
cost_A=math.floor(A/0.08)
cost_B=B*10
if cost_A<=cost_B and cost_B < cost_A+1:
    ans=cost_B
elif cost_B<=cost_A and cost_B <cost_A+1:
    ans=cost_A
else:ans=-1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
ans = 0
a_min = 12.5 * a
a_max = 12.5 * (a + 1)
b_min = 10 * b
b_max = 10 * (b + 1)
min = max(a_min,b_min)
if min < a_max and min < b_max:
    ans = min
else:
    ans = -1
print(int(ans))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
Ax = A * 25 / 2
Ay = (A + 1) * 25 / 2
Bx = B * 10
By = (B + 1) * 10

if Ay <= Bx or By <= Ax:
    print(-1)
else:
    ans = max(Bx, Ax)
    if ans % 1:
        ans = int(ans)
        ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
A,B = map(int,input().split())
target_8  = int(A * (100/8))
target_10 = int(B * (100/10))

if int(target_8*0.1) == B :
    print(target_8)
    sys.exit()
elif int(target_10*0.08) == A :
    print(target_10)
    sys.exit()
else:
    print('-1')
    sys.exit()

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
yenA = int(A / 0.08)
yenB = int(B / 0.1)
if yenA == yenB:
    print(yenA)
else:
    print(-1)

Submission status: Wrong Answer

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

vlaue_a = 12.5*a
value_b = int(0.1*vlaue_a)
ans = 0

if b == int(value_b):
    ans = vlaue_a
else:
    ans = -1

print(int(ans))

Submission status: Wrong Answer

Solution code:
import sys
import math
sys.setrecursionlimit(int(1e6))

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

pa = A / 0.08
pb = B / 0.10

if int(pa) == int(pb):
    print(int(pa))
elif int(pa + 0.08) == int(pb):
    print(min(int(pa + 0.08), int(pb)))
elif int(pa) == int(pb + 0.1):
    print(min(int(pa), int(pb + 0.1)))
elif int(pa+0.08) == int(pb + 0.1):
    print(int(pa+0.08), int(pb + 0.1))
else:
    print(-1)

Submission status: Wrong Answer

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

ans1 = int(A/0.08)
ans2_max = ans1 + ans1*0.1
ans2 = int(B*10)
if ans2 <= ans2_max:
    print(ans1)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
#At coder 2020/3/8 C
import math

I = list(map(int, input().split())) 
A=I[0]
B=I[1]

a1=A/0.08
b1=B/0.1

a2=(A+1)/0.08
b2=(B+1)/0.1

af=math.ceil(a1)
ac=math.ceil(a2)
bf=math.ceil(b1)
bc=math.ceil(b2)
if ac<=bf or bc<=af:
    ans=-1
else:
    ans=min(af,bf)

print(ans)

Submission status: Wrong Answer

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

a = [math.ceil(a * 12.5),(a + 1) * 12.5]
b = [math.ceil(b * 10),math.floor((b + 1) * 10)]
print(a)
print(b)
if max(a[0], b[0]) < min(a[1], b[1]):
    print(max(a[0], b[0]))
else:
    print(-1)

Submission status: Wrong Answer

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

N_A = A / 0.08
N_B = B / 0.1

A_list = list()
N = N_A
while N * 0.08 < A+1:
    A_list.append(N)
    N += 1

B_list = list()
N = N_B
check = 0
while N * 0.08 < B+1:
    if N in set(A_list):
        check = 1
        print(int(N))
        break
    
    N += 1

if check == 0:
    print(-1)

Submission status: Wrong Answer

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

n = a / 0.08
m = b / 0.1

#print(n,m)

if n == m:
    print(int(n))
    exit()

s = math.floor(n*0.08)
t = math.floor(n*0.1)

if s == t:
    print(int(n))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
A, B = [int(x) for x in input().split()]

A /= 0.08
B /= 0.1

if int(A) == int(B):
    print(int(A))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a,b = map(int,input().split())
a1 = int(a/0.08)
b1 = int(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

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
a=0
b=0
c=-1
for i in range(1,101):
  a=int(i*0.08)
  b=int(i*0.1)
  if a==s[0]:
    if b==s[1]:
      c=i
      break
print(c)

Submission status: Wrong Answer

Solution code:
import math

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

for i in range(b+1,1000):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
else:
    ans = -1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
xa=a/0.08
xa_ans=[]

temp=int(xa//1)
while(int(temp*0.08//1)==a):
    xa_ans.append(temp)
    temp-=1


temp=int(xa//1)
while(int(temp*0.08//1)==a):
    xa_ans.append(temp)
    temp+=1


xb=b/0.10
xb_ans=[]

temp=int(xb//1)
while(int(temp*0.10//1)==b):
    xb_ans.append(temp)
    temp-=1

temp=int(xb//1)
while(int(temp*0.10//1)==b):
    xb_ans.append(temp)
    temp+=1

ans=sorted(list(set(xa_ans) & set(xb_ans)))
if(len(ans)==0):
    print(-1)
else:
    print(ans[0])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(A: int, B: int):
    
    from math import floor, ceil
    ans = INF
    for i in range(1, 101):
        for j in range(i, 101):
            if floor(i*0.08) == A and floor(j*0.1) == B:
                ans = min(ans, i)   

    if ans != INF:
        print(ans)
    else:
        print(-1)

    return



def main():
    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
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

n=int(-(-A//0.08))

if n//10==B:
    print(n)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import math
a, b = map(int, input().split())
x1 = 100 * (a/8.)
x2 = 100 * (b/10.)
if int(x1) == int(x2):
  print(int(x1))
elif int(x1 / 10) == b:
  print(int(x1))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29

def main():
    a,b = map(int,input().split())
    ans = 0
    for i in range(10):
        for j in range(10):
            x = (a+i/10)/0.08
            y = (b+j/10)/0.1
            if x==y:
                print(int(x))
                return
    print(-1)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

am=math.ceil(A/0.08)
bm=math.ceil(B/0.1)
aM=math.ceil((A+1)/0.08)
bM=math.ceil((B+1)/0.1)
if max(am,bm)>min(aM,bM):
    print(-1)
else:
    print(max(am,bm))

Submission status: Wrong Answer

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

def main():
    a1, b1 = map(int, input().split())
    a2 = a1 / 0.08
    b2 = b1 / 0.10
    if a2 >= b2:
        if math.floor(a2 * 0.10) == b1:
            print(int(a2))
        else:
            print('-1')
    else:
        if math.floor(b2 * 0.08) == a1:
            print(int(b2))
        else:
            print('-1') 

main()

Submission status: Wrong Answer

Solution code:
a,b = (int(x) for x in input().split())

x_a = int(a/0.08)
x_b = int(b/0.1)

a_list = [x+x_a for x in range(12)]
b_list = [x+x_b for x in range(9)]

output = -1
for v in a_list:
  if v in b_list:
    output = v
    break
    
print(output)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
x=int(a/0.08)
y=int(b/0.1)
print(max(x,y))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
x = int(A*12.5)
y = int(B*10)
inf = min(x, y)
sup = max(x, y)
f = False
for a in range(inf, sup+1):
    if int(a*0.08)==A and int(a*0.1)==B:
        f = True
        break
if f:
    print(a)
else:
    print(-1)

Submission status: Wrong Answer

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

x_min = A * 12.5
if x_min.is_integer:
  x_min = int(x_min)
else:
  x_min = int(x_min) + 1

x_max = int((A + 0.99) * 12.5)

ans = -1
for n in range(x_min, x_max + 1):
  if n // 10 == B:
    ans = n
    break

print(ans)

Submission status: Wrong Answer

Solution code:
import math
A,B=map(int,input().split())
a=math.floor(A/0.08)
if math.floor(a*0.1)==B:
    print(a)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
amin=int(25*a/2+0.6)
amax=int(25*a/2+25/2)
bmin=10*b
bmax=10*b+9
if bmax<amin or amax<bmin:
  print(-1)
else:
  print(max(bmin,amin))

Submission status: Wrong Answer

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

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