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

Submission attempts (in order):
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import sys
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = map(int, sys.stdin.readline().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

print(notax_min_from8)
print(notax_min_from10)
print(notax_max_from8)
print(notax_max_from10)


if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print(-1)
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = (int(x) for x in input().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print('-1')
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = (int(x) for x in input().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print("{}".format(-1))
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = (int(x) for x in input().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print(-1)
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = (int(x) for x in input().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print("{}".format('-1'))
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = (int(x) for x in input().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print("{}".format(-1))
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import sys
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = map(int, sys.stdin.readline().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

print(notax_min_from8)
print(notax_min_from10)
print(notax_max_fromA8)
print(notax_max_from10)


if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print(-1)
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import sys
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = map(int, sys.stdin.readline().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

# print(notax_min_from8)
# print(notax_min_from10)
# print(notax_max_from8)
# print(notax_max_from10)
# print(notax_min_from10 > notax_max_from8)
# 

if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_max_from10):
    print(-1)
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)


#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /PycharmProjects/atcoder/C-TaxIncrease.py
#
A, B = map(int, input().split())
ans = -1
for i in range (1000 + 1):
    if (int(i*0.08) == A) and (int(i*0.10) == B):
        ans = i
        break
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted