Problem:


Score: 200 points

Problem Statement

Takahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it.

The consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \times 1.08 yen (rounded down to the nearest integer).

Takahashi forgot the price of his apple pie before tax, X, and wants to know it again. Write a program that takes N as input and finds X. We assume X is an integer.

If there are multiple possible values for X, find any one of them. Also, Takahashi's memory of N, the amount he paid, may be incorrect. If no value could be X, report that fact.

Constraints

1 \leq N \leq 50000

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

If there are values that could be X, the price of the apple pie before tax, print any one of them.

If there are multiple such values, printing any one of them will be accepted.

If no value could be X, print :(.

Sample Input 1

432

Sample Output 1

400

If the apple pie is priced at 400 yen before tax, you have to pay 400 \times 1.08 = 432 yen to buy one.

Otherwise, the amount you have to pay will not be 432 yen.

Sample Input 2

1079

Sample Output 2

:(

There is no possible price before tax for which you have to pay 1079 yen with tax.

Sample Input 3

1001

Sample Output 3

927

If the apple pie is priced 927 yen before tax, by rounding down 927 \times 1.08 = 1001.16, you have to pay 1001 yen.



Sample input:
432


Sample output:
400

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_b

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n = int(input())

    for i in range(1, n+1):
        price = int(i * 1.08)
        if price == n:
            print(i)
            return

    print(':(')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# 小数点以下は切り捨て
import math
X = int(input())
price = math.ceil(X * 100 / 108)
# print(price)
# print(price*1.08)
if int(price * 1.08) == X:
    print(price)
else:
    print(":(")

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())

    X = int(N/1.08)

    if int(X*1.08) == N:
        print(X)
    elif int(((X+1)*1.08)) == N:
        print(X+1)
    else:
        print(':(')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

ans = -1

for i in range(1,N+1):
    if int(i*1.08) == N:
        ans = i

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

Submission status: Accepted

Solution code:
N = int(input())


for i in range(N+1):
    if(N == int(i*1.08)):
        print(i)
        ans = True
        break
    else:
        ans = False

if(ans == False):
    print(":(")

Submission status: Accepted

Solution code:
import math
N=int(input())
a=math.ceil(N/1.08)
b=math.floor(a*1.08)
print(a if N==b else ":(")

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(input())
X = int(N/1.08)
cn1 = int(X*1.08)
cn2 = int((X+1)*1.08)
if cn1==N: print(X)
elif cn2==N: print(X+1)
else: print(":(")

Submission status: Accepted

Solution code:
import math
N = int(input())
X = math.ceil(N / 1.08)
if int(X*1.08) == N:
    print(X)
else:
    print(':(')

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
for i in range(1,n+100):
    if int(i*1.08) == n:
        print(i)
        break
else:
    print(':(')

Submission status: Accepted

Solution code:
import math
n = int(input())
px_up = math.ceil(n/1.08)
px_next = (n+1)/1.08
 
if px_up < px_next:
  print(px_up)
else:
  print(":(")

Submission status: Accepted

Solution code:
import sys
from math import ceil

def main():
    n = int(sys.stdin.readline().rstrip())
    x = ceil(n / 1.08)

    res = []
    while x * 27 // 25 == n:
        res.append(x)
        x += 1
    if res:
        print(res[0])
    else:
        print(':(')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
 
ans = 0
 
for i in range(100):
    val = 100 * n + i
    if val % 108 == 0:
        ans = val // 108
        break
    else:
        pass
 
print(':(') if ans == 0 else print(ans)

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor
def main():
    n = int(sys.stdin.readline().rstrip())
    x = ceil(n / 1.08)
    if floor(x * 1.08) == n:
        print(x)
    else:
        print(':(')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys 

N = int(input())

for i in range(1,50001):
  if int(i*1.08) == N:
    print(i)
    sys.exit()
    
print(":(")

Submission status: Accepted

Solution code:
n=int(input())
a=(int)(n/1.08)
if (int)(a*1.08)==n:
  print(a)
elif (int)((a+1)*1.08)==n:
  print(a+1)
else:
  print(":(")

Submission status: Accepted

Solution code:
import math

n=int(input())

x = math.floor(n /1.08)

if math.floor(x*1.08) == n:
    print(x)
elif math.floor((x+1)*1.08) == n:
    print(x+1)
else:
    print(":(")

Submission status: Accepted

Solution code:
from math import floor
N=int(input())
X=N//1.08
if floor(X*1.08)==N:
  print(int(X))
else:
  if floor((X+1)*1.08)==N:
    print(int(X)+1)
  else:
    print(":(")

Submission status: Accepted

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

N = int(input())

X = N / 1.08

if X - int(X) > 0:
    X = X + 1

X = int(X)

# 検算
if int(X * 1.08) == N:
    print(int(X))
else:
    print(':(')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def solve():
  n = int(input())
  tax = n-n/(1.08)
  price = n-tax//1
  if n == price*1.08//1:
    print(int(price))
  else:
    print(":(")
solve()

Submission status: Accepted

Solution code:
N = int(input())

# N円で買える金額
X_low = 1
# N円で買えない金額
X_high = 50001


def can_buy(price):
    return int(price * 1.08) <= N


while X_high - X_low > 1:
    x = int(X_high + X_low) // 2
    if can_buy(x):
        X_low = x
    else:
        X_high = x

if int(X_low * 1.08) == N:
    print(X_low)
else:
    print(":(")

Submission status: Accepted

Solution code:
n = int(input().strip())
for i in range(n+1):
  if i + (i * 8 // 100) == n:
    print (i)
    break
else:
  print (":(")

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n+100):
    if ((i*1.08)//1) == n:
        print(i)
        exit()
print(':(')

Submission status: Accepted

Solution code:
n = int(input())
err = ':('
tax = 1.08

pnum = int(n / tax)
anum = pnum + 1

if int(pnum*tax) == n:
    print(pnum)
elif int(anum*tax) == n:
    print(anum)
else:
    print(err)

Submission status: Accepted

Solution code:
import sys
import math

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
x = math.ceil(N / 1.08)
bool = True
if math.floor(x * 1.08) != N:
    bool = False
print(int(x) if bool else ':(')

Submission status: Accepted

Solution code:
N=int(input())
X=(N+1)*100//108
if X*108//100==N:
  print(X)
else:
  print(':(')

Submission status: Accepted

Solution code:
n = int(input().strip())

for i in range(1, 50001):
    if int(i * 1.08) == n:
        print(i)
        break
else:
    print(":(")

Submission status: Accepted

Solution code:
import math

N = int(input())

tax = 1.08
ans_floor = math.floor(N/tax)
ans_ceil  = math.ceil(N/tax)

if math.floor(ans_floor * tax) == N:
  print(ans_floor)
elif math.floor(ans_ceil * tax) == N:
  print(ans_ceil)
else:
  print(":(")

Submission status: Accepted

Solution code:
import math

n = int(input())

out = n/1.08

if math.floor(math.ceil(out)*1.08) == n:
  print(math.ceil(out))
else:
  print(":(")

Submission status: Accepted

Solution code:
n=int(input())+1;print(n%27%14and int(n/1.08)or':(')

Submission status: Accepted

Solution code:
n=int(input())*25;m=(n+24)//27;print((m,':(')[m*27<n])

Submission status: Accepted

Solution code:
n=int(input());print(([m for m in range(n+1)if int(m*1.08)==n]+[':('])[0])

Submission status: Accepted

Solution code:
a = int(input().strip())

for n in range(1, 50001):
    if int(n * 1.08) == a:
        print(n)
        break
else:
    print(":(")

Submission status: Accepted

Solution code:
def b():
	from math import floor,ceil
	N = int(input())
	bef = N / 1.08
	if int(floor(bef) * 1.08) == N:
		print(floor(bef))
	elif int(ceil(bef) * 1.08) == N:
		print(ceil(bef))
	else:
		print(":(")
b()

Submission status: Accepted

Solution code:
n=int(input())
flag=True
for i in range(50000):
  if int(i*1.08)==n:
    print(i)
    flag=False
    break
if flag:
  print(":(")

Submission status: Accepted

Solution code:
import math

N = int(input())

X = float(N/1.08)
X2 = math.ceil(X)

if N == math.floor(math.ceil(X)*1.08):
 print(X2)

else:
 print(':(')

Submission status: Accepted

Solution code:
n = int(input().strip())
rate = 1.08

if int((n//rate+1)*rate) == n:
    print(int(n//rate+1))
else:
    print(":(")

Submission status: Accepted

Solution code:
n = int(input())

ans = -1
for i in range(1, 50000):
    if int(i * 1.08) == n:
        ans = i
        break

if ans == -1:
    print(":(")
else:
    print(ans)

Submission status: Accepted

Solution code:
import math
a = int(input())

X = math.ceil(a/1.08)

if math.floor(X*1.08) == a: 
    print(X)
else:
    print(":(")

Submission status: Accepted

Solution code:
N = int(input())

ans = -1
for x in range(N+1):
  if(int(x*1.08) == N):
    ans = x
    break
    
if(ans == -1): print(':(')
else: print(ans)

Submission status: Accepted

Solution code:
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()
candi = int(N / 1.08)
if int(candi * 1.08) == N:
    print(candi)
elif int((candi + 1) * 1.08) == N:
    print(candi + 1)
else:
    print(':(')

Submission status: Accepted

Solution code:
N = int(input())
not_N = N+1
N = N/1.08
not_N = not_N/1.08
cand1 = int(N)
cand2 = int(not_N)+1
flag = True
for one in range(cand1, cand2+1):
    if one>=N and one<not_N:
        print(one)
        flag=False
        break
if flag:
    print(':(')

Submission status: Accepted

Solution code:
N = int(input())
X = int(N/1.08)
if int(X*1.08) == N:
  print(X)
else:
  if int((X+1)*1.08) == N:
    print(X+1)
  else:
    print(':(')

Submission status: Accepted

Solution code:
N = int(input())
for i in range(1, 50001):
    if int(i * 1.08) == N:
        print(i)
        exit()
print(':(')

Submission status: Accepted

Solution code:
def main():
    from math import ceil, floor
    N = int(input())
    X = ceil(N/1.08)
    if floor(X*1.08) == N:
        print(X)
    else:
        print(":(")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import ceil

n = int(input())
x = ceil(n / 1.08)
print(x if int(x * 1.08) == n else ':(')

# n=floor(x*1.08)
# n<=x*1.08<n+1
# n/1.08<=x<(n+1)/1.08

# xの必要条件は、
# n/1.08<=x<(n+1)/1.08
# xは整数

# xは整数とn/1.08<=xから、
# ceil(n/1.08)である必要があるので、これがnに一致すれば、
# n/1.08<=x<(n+1)/1.08
# この範囲に整数がある

Submission status: Accepted

Solution code:
n = int(input())
x = int(n/1.08)
n_x = int(x*1.08)
ans_list = [int(x-1), x, int(x+1)]
for key, i in enumerate(ans_list):
  checker = int(i*1.08)
  if checker == n:
    print(i)
    break
  elif key==2:
    print(":(")

Submission status: Accepted

Solution code:
price = int(input())
ans = ":("

for i in range (1, 50001):
  if int(i * 1.08) == price:
    ans = i

print(ans)

Submission status: Accepted

Solution code:
usrInput = input()
import math
taxRate = 0.08
finding = 1
whileIs = True
foundIs = False

while whileIs == True:
    if math.floor(finding * (taxRate + 1)) == int(usrInput):
        unTaxed = finding
        whileIs = False
        foundIs = True
    else:
       if 49300 <= finding:
        whileIs = False
        foundIs = False
    finding = finding + 1

if foundIs:
    print(str(unTaxed))
else:
    print(":(")

Submission status: Accepted

Solution code:
x = int(input())
n = x / 1.08
n = int(n)
for i in range(n-2, n+3):
    if int(i * 1.08) == x:
        print(i)
        break
else:
    print(':(')

Submission status: Accepted

Solution code:
n=int(input())
x=n/1.08
if x%1==0:
  print(int(x))
elif int((int(x)+1)*1.08)==n:
  print(int(x)+1)
else:
  print(':(')

Submission status: Accepted

Solution code:
#coding: utf-8
from math import ceil, floor
N = int(input())
tmp = ceil(N / 1.08)
if floor(tmp * 1.08) == N:
    print(tmp)
else:
    print(":(")

Submission status: Accepted

Solution code:
import math
n = int(input())
a = math.ceil(n/1.08)
if int(a*1.08) == n:
    print(a)
else:
    print(':(')

Submission status: Accepted

Solution code:
import math
def main():

    N = int(input())
    v2 = math.ceil(N/1.08)
    v1 = math.floor(N/1.08)
    for v in range(v1, v2+1):
        if int(v * 1.08) == N:
            return v
    return ':('


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

Submission status: Accepted

Solution code:
import math

N = int(input())

for i in range(1, 50001):
  if math.floor(i*1.08) == N:
    print(i)
    exit()

print(':(')

Submission status: Accepted

Solution code:
N=int(input())

X=int(N/1.08)
if int(X*1.08)==N:
    print(X)
elif int((X+1)*1.08)==N:
    print(X+1)
else:
    print(":(")

Submission status: Accepted

Solution code:
import sys, math
from collections import defaultdict
from copy import deepcopy
import itertools
input = sys.stdin.readline
# 文字列の場合は普通のinput()を使うか下を使う
# input = sys.stdin.readline().rstrip()

N = int(input())
#print('pre={}, post={}'.format(N/1.08, (N+1)/1.08))

if math.floor(N / 1.08) == N / 1.08:
    print(math.floor(N / 1.08))
elif math.floor((N + 1) / 1.08) == (N + 1) / 1.08:
    X = math.floor((N + 1) / 1.08) - 1
    Y = N / 1.08
    if Y < X:
        print(X)
    else:
        print(':(' )
else:
    X = math.floor((N + 1) / 1.08)
    Y = N / 1.08
    if Y < X:
        print(X)
    else:
        print(':(' )

Submission status: Accepted

Solution code:
n = int(input())
m = int(n / 1.08)

if int(m * 1.08) == n:
    print(m)
elif int((m + 1) * 1.08) == n:
    print(m + 1)
else:
    print(":(")

Submission status: Accepted

Solution code:
n=int(input())
for i in range(50001):
  if i*1.08//1 == n:
    print(i)
    break
else:
  print(":(")

Submission status: Accepted

Solution code:
n=int(input())
for i in range(50001):
  if i*1.08//1 == n:
    print(i)
    break
else:
  print(":(")

Submission status: Accepted

Solution code:
input_ = int(input())

for i in range(input_):
  if int((i+1)*1.08) == input_:
    print(i+1)
    break
else:
  print(":(")

Submission status: Accepted

Solution code:
import sys

#+++++
		
def main():
	n=int(input())
	for i in range(n+1):
		if int(i*1.08) == n:
			return i
	print(':(')
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
import math
N = int(input())
N_test = math.ceil(N / 1.08)

if math.floor(N_test * 1.08) == N:
  print(N_test)
else:
  print(":(")

Submission status: Accepted

Solution code:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()
 
show_flg=False
show_flg=True



n=I()

ans=':('
for i in range(n,-1,-1):
    if int(i*1.08)==n:
        ans=i
        break
    
    
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())

ans = -1

for x in range(N+1):
    if math.floor(x * 1.08) == N:
        ans = x
        break
if ans == -1:
  print(":(")
else:
  print(ans)

Submission status: Accepted

Solution code:
from math import floor, ceil


if __name__ == "__main__":
    n = int(input())

    ans = n * 100 / 108

    if ceil(ans) * 108 // 100 == n:
        print(ceil(ans))
    elif floor(ans) * 108 // 100 == n:
        print(floor(ans))
    else:
        print(':(')

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = -1
for x in range(N+1):
    if math.floor(x * 1.08) == N:
        ans = x
        break
print(ans if ans is not -1 else ':(')

Submission status: Accepted

Solution code:
N = int(input())
import math

x = math.ceil(N / 1.08)
print(str(x) if math.floor(x * 1.08) == N else ':(')

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
k = 0
for i in range(N+1):
    if N<=i*1.08<N+1:
        print(int(i))
        ans += 1
        break
if ans == 0:
    print(":(")

Submission status: Accepted

Solution code:
s =int(input())
if s % 27 == 13 or s % 27 == 26:
    print(':(')
else:
    print((-s * 25 // 27) * (-1))

Submission status: Accepted

Solution code:
# your code goes here
def my_index(l, x, default=False):
    if x in l:
        return int(l.index(x))+1
    else:
        return default

ans = []

num = int(input())

for i in range(1,50001):
    ans.append(int(i*1.08))

print(my_index(ans,num,":("))

Submission status: Accepted

Solution code:
import math

n = int(input())
X =round(n/1.08)
x_list = [X-1,X,X+1]

for x in x_list:

    if math.floor(x * 1.08) == n:
        ans = x
        break
    else:
        ans = ":("
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
swith = 0
import math

for i in range(50000):
    a_i = math.floor(i * 1.08)
    if a_i == N:
        print(i)
        swith = 1
        break

if swith == 0:
    print(":(")

Submission status: Accepted

Solution code:
n=input()
n=int(n)
import math
x1=n/1.08

a=math.floor(math.floor(x1)*1.08)
b=math.floor(math.ceil(x1)*1.08)
if n==a:
	print(math.floor(x1))
elif n==b:
	print(math.ceil(x1))
else:
	print(':(')

Submission status: Accepted

Solution code:
X = int(input())
import math

A = X * 100
B = A / 108

C = math.ceil(B)
D = C * 108
E = D // 100

F = math.floor(B)
G = F * 108
H = G // 100


if X == E or X == H:
	print(C)
else:
	print(":(")

Submission status: Accepted

Solution code:
def my_index(l, x, default=False):
    if x in l:
        return int(l.index(x))+1
    else:
        return default
 
ans = []
 
num = int(input())
 
for i in range(1,50001):
    ans.append(int(i*1.08))
 
print(my_index(ans,num,":("))

Submission status: Accepted

Solution code:
import math
n = int(input())
x = math.ceil(n/1.08)
if (n+1)/1.08  > x:
  print(x)
else:
  print(":(")

Submission status: Accepted

Solution code:
import math
import sys
N = int(input())

for i in range(N+1):
  if math.floor(i * 1.08) == N:
    print(i)
    sys.exit()
    
print(':(')

Submission status: Accepted

Solution code:
import math
N = int(input())
n = N //1.08
x = math.floor(n*1.08)
y = math.floor((n-1)*1.08)
z = math.floor((n+1)*1.08)
if (N == x):
  ptint(math.floor(n))
  
elif N == y:
  print(math.floor(n-1))
elif N == z:

  print(math.floor(n+1))
else:
  print(':(')

Submission status: Accepted

Solution code:
import math
N = int(input())
for X in range(1, 50000):
    if N == math.floor(X * 1.08):
        break
    else:
         X = ':('

print(X)

Submission status: Accepted

Solution code:
N = int(input())

print(int((N + 1) / 1.08)
      if 100 * N % 108 == 0 or 100 * (N + 1) % 108 != 0 and int(N / 1.08) + 1 == int((N + 1) / 1.08) else ':(')

Submission status: Accepted

Solution code:
n = int(input())
ans=int(n/1.08)
if(int(ans*1.08)!= n):
    if(int((ans+1)*1.08)== n):
        print(int(ans+1))
    elif((int((ans-1)*1.08)== n)):
        print(int(ans+1))
    else:
        print(":(")
else:
    print(ans)

Submission status: Accepted

Solution code:
import math

N=input()
N=float(N)
X=N/1.08
X1=math.floor(N/1.08)
X2=math.ceil(N/1.08)
if X.is_integer() == True  or math.floor(X2*1.08)== N:
	print(math.ceil(X))
else :
	print(":(")

Submission status: Accepted

Solution code:
N = int(input())

ans = N * 100 // 108
#print(ans)
if N * 100 % 108 != 0:
    ans += 1
#print(ans)
if int(ans * 1.08) == N:
    print('{}'.format(ans))
else:
    print('{}'.format(':('))

Submission status: Accepted

Solution code:
from math import ceil

N = int(input())
res = N / 1.08

if res != 0:
    up = ceil(N / 1.08)
    down = int(N / 1.08)
    up2   = int(up * 1.08)
    down2 = int(down * 1.08)

    if down2 == N:
        print(down)
    elif up2 == N:
        print(up)

    else:
        print(":(")

else:
    print(res)

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input().rstrip())

low = 0
high = 50000

# 二分探索
while high-low > 1:
    mid = (high+low)//2
    mid_x = int(mid*1.08)

    if mid_x == n:
        print(mid)
        exit()
    elif mid_x > n:
        high = mid
    elif mid_x < n:
        low = mid

print(":(")

Submission status: Accepted

Solution code:

import math
a=int(input())
if (a/1.08)%1==0:
    print (math.ceil(a/1.08))
else:
    m=math.ceil(a/1.08)
    if a==math.floor(m*1.08):
        print(math.floor(m))
    else:
        print(":(")

Submission status: Accepted

Solution code:
import math
N = int(input())

sum = int(math.ceil(N/1.08))

if( sum == 0 ):
  print(':(')
elif (int(sum*1.08) != N):
  print(':(')
else:
  print(sum)

#print(sum)
#print(int(sum*1.08))
#print(D1)
#print(M2)
#print(D2)

Submission status: Accepted

Solution code:
import math


def inputs():
    return [int(s) for s in input().split()]


def main():
    N = int(input())

    v = math.ceil(N / 1.08)

    if math.floor(v * 1.08) == N:
        return v
    else:
        return ':('


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

Submission status: Accepted

Solution code:
import math
 
n = int(input())
L = []
for val in range(0,50001):
    L.append(int(val*1.08))
 
#print(L)
 
#ans = int(n/1.08)
ans = math.ceil(n/1.08)
if n in L:
    print(ans)
else:
    print(":(")

Submission status: Accepted

Solution code:
n = int(input())
x = int(n / 1.08)
if (int(x * 1.08) == n):
    print(x)
elif (int((x + 1) * 1.08) == n):
    print(x + 1)
else:
    print(":(")

Submission status: Accepted

Solution code:
print((lambda a,x: a.index(x) if a.count(x) else ":(")([i*108//100 for i in range(50505)],int(input())))

Submission status: Accepted

Solution code:
N = int(input())
for ans in range(50001):
    if int(ans * 1.08) == N:
        print(ans)
        quit()
print(":(")

Submission status: Accepted

Solution code:
n = int(input())
a = n//1.08
if int(a*1.08) == n:
  print(int(a))
elif int((a+1)*1.08) == n:
  print(int(a+1))
else:
  print(':(')

Submission status: Accepted

Solution code:
import math
import sys
 
n = int(input())

ln = {}

for m in range(0, 50000):
  ln[(math.floor(m * 1.08))] = m

if n in ln.keys():
  print(ln[n])
else:
  print(':(')

Submission status: Accepted

Solution code:
from math import floor
N = int(input())

def doit(tmp):
	xmin = tmp / 1.08
	xmax = (tmp + 1) / 1.08

	if floor(xmin) == xmin:
		return(int(xmin))
	if floor(xmax) == xmax:
		return(":(")
	else:
		if floor(xmin) == floor(xmax):
			return(":(")
		if floor(xmin) < floor(xmax):
			return(floor(xmax))

print(doit(N))

Submission status: Accepted

Solution code:
import math

n = int(input())

i = 0
while math.floor(i * 1.08) < n:
    i += 1

if math.floor(i * 1.08) == n:
    print(i)
else:
    print(":(")

Submission status: Accepted

Solution code:
n = int(input())

x = n / 1.08

if (int(int(x) * 1.08) == n):
    print(int(x))
elif (int((int(x) + 1) * 1.08) == n):
    print(int(x) + 1)
else:
    print(":(")

Submission status: Accepted

Solution code:
n=int(input())
minx=int(n/1.08)
maxx=n+1
ans=":("
for x in range(minx,maxx):
	if x*1.08-1<n and n<=x*1.08:
		ans=x
		break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = -1
for X in range(1, N+1):
    if str(X*108)[:-2]==str(N): ans = X
print(ans if ans>-1 else ':(')

Submission status: Accepted

Solution code:
N = int(input())
a = int(N//1.08 - 1)
if int(a*1.08//1) == N:
  print(a)
  exit(0)
b = int(N//1.08)
if int(b*1.08//1) == N:
  print(b)
  exit(0)
c = int(N//1.08 + 1)
if int(c*1.08//1) == N:
  print(c)
  exit(0)
print(":(")

Submission status: Accepted

Solution code:
import math
n = int(input())
f=0
for i in range(1,n+1):
    x = math.floor(i*1.08)

    if x==n:
        f=1
        xx = i
        break

if f:
    print(xx)
else:
    print(':(')

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
x = 1.08

for i in range(1,50001):
    if int(i * x) == n:
        ans = i
        break
if ans == 0:
    ans = ':('
print(ans)

Submission status: Accepted

Solution code:
from math import floor

n = int(input())
tax = 1.08
no_tax = floor(n / tax)

if floor(no_tax * 1.08) == n:
  print(no_tax)
elif floor((no_tax+1) * 1.08) == n:
  print(no_tax+1)
else:
  print(":(")

Submission status: Accepted

Solution code:
N = int(input())
X = int((N / 1.08)//1)
X1 =int(X+1) 
ans_1 = (X*1.08//1)
ans_2 = (X1*1.08//1)
if (ans_1 == N):
    print(X)
elif(ans_2 == N):
    print(X1)
else:
    print(":(")

Submission status: Accepted

Solution code:
N = int(input())
A = int(N/1.08)
if int(A*1.08) == N:
  print(A)
elif int((A+1)*1.08) == N:
  print(A+1)
else:
  print(':(')

Submission status: Accepted

Solution code:
import math

s = int(input())

te = s % 1.08
if te < 0.1:
  print(':(')
else:
  x = s / 1.08
  print(math.ceil(x))

Submission status: Accepted

Solution code:
N=int(input())
X=N/1.08

while X<N+100:
    check=int(X//1)*1.08
    if check//1==N:
        print(int(X//1))
        count=1
        break
    count=0
    X=X+1
if count!=1:
    print(":(")

Submission status: Accepted

Solution code:
import math
n = int(input())

if(n%1.08>0 and n%1.08<0.1):
    print(":(")
else:
    print(math.ceil(n/1.08))

Submission status: Accepted

Solution code:
import math
n=int(input())
count=0
for i in range(1,n+1):
    count+=1
    a=math.floor(i*1.08)
    if a==n:
        print(i)
        exit()
print(":(")

Submission status: Accepted

Solution code:
import math

def main():
    x = int(input())
    ans = 0
    ans1 = math.floor(x / 1.08)
    ans2 = math.ceil(x / 1.08)
    if math.floor(ans1 * 1.08) == x:
        print(ans1)
        return
    elif math.floor(ans2 * 1.08) == x:
        print(ans2)
        return
    else:
        print(":(")

main()

Submission status: Accepted

Solution code:
N = int(input())

import math

L = []
A = int(N//1.08)
for i in range(A-1, A+2):
    if math.floor(i*1.08) == N:
        L.append(i)
if L != []:
    print(min(L))
else:
    print(":(")

Submission status: Accepted

Solution code:
N=int(input())
v1=int(N/1.08)
v2=int((N+1)/1.08)
if N<=1.08*v2<N+1:
  print(v2)
elif N<=1.08*v2<N+1:
  print(v1)
else:
  print(':(')

Submission status: Accepted

Solution code:
N = int(input())

A = int(N / 1.08)

result = ":("

for i in [A - 1, A, A + 1]:
    if int(i * 1.08) == N:
        result = i
        break

print(result)

Submission status: Accepted

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

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

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

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

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
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

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

import random


def main():
    n = int(input().strip())
    nn=int(n//1.08)
    nnn=nn+1
    if int(nn*1.08) == n:
        print(nn)
    elif int(nnn*1.08) == n :
        print(nnn)
    else:
        print(":(")
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
n = int(input())
if (n+1)%27 == 0 or (n+14)%27 == 0:
    print(":(")
else:
    print(math.ceil(n/1.08))

Submission status: Accepted

Solution code:
import math

N = int(input());

dev_n = math.ceil(N / 1.08)
rep_n = int(math.floor(dev_n * 1.08))
if N == rep_n:
    print(dev_n)
else:
    print(':(')

Submission status: Accepted

Solution code:
n = int(input())

i = int(n * 0.8)
cnt = 0
while i < n+1:
  if int(i*1.08) == n:
    print(i)
    cnt = 1
    break
  else:
    i += 1
if cnt == 0:
  print(":(")

Submission status: Accepted

Solution code:
N = int(input())
t1 = int(N/1.08)
for i in [t1-1,t1,t1+1]:
    if N == int(i*1.08):
        print(i)
        exit()
print(':(')

Submission status: Accepted

Solution code:
import math

n = int(input())

x = math.ceil(n/1.08)

if n == int(int(x)*1.08):
    print(int(x))
else:
    print(":(")

Submission status: Accepted

Solution code:
import math
m = int(input())
x = math.ceil(m/1.08)
if math.floor(x*1.08) == m:
    print(x)
else:
    print(":(")

Submission status: Accepted

Solution code:
n = int(input())
xx = (100 * n // 108) + 1
# print(xx)
for x in range(xx + 1):
    nn = int(x * 1.08 // 1)
    if n == nn:
        print(x)
        exit(0)
print(':(')

Submission status: Accepted

Solution code:
n = int(input())

m = 1
while int(m*1.08) < n:
    m += 1

print(m) if int(m*1.08) == n else print(":(")

Submission status: Accepted

Solution code:
n = int(input())#税込み
x = int(-(-n//1.08))#税抜き

if (n+1)%27 == 0 or (n+14)%27 == 0:
    print(":(")
else:
    print(x)

Submission status: Accepted

Solution code:

n1 = int(input())*100
n2 = n1+100
x = -((-n1)//108)
y = n2/108
z = n1%108

if z ==0:
	print(n1//108)
else:
	if x <y:
		print(x)
	else:
		print(":(")

Submission status: Accepted

Solution code:
n = int(input())
temp = ':('
for i in range(1,50000):
  if n == int(1.08*i):
    temp = i
    break;
print(temp)