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: Runtime Error

Solution code:
import math

n = int(input())

x = round(n/1.08)

xx =n/1.08
y =x*1.08

if n.is_integer() == "false":
    print(":(")


if xx.is_integer():
    print(int(n/1.08))
else:
    if n==math.floor(y):
        print(int(x))
    else:
        print(":(")

Submission status: Runtime Error

Solution code:
def check_untaxed_price(taxed_price, rate=1.08):
    X = taxed_price/rate
    c, f = np.ceil(X),np.floor(X)
    if int(c * rate)==taxed_price:
        return str(int(c))
    elif int(f * rate)==taxed_price:
        return str(int(f))
    else:
        return ":("
 
N = int(input())
print(check_untaxed_price(N))

Submission status: Runtime Error

Solution code:
s = input()

if s % 1.08 < 0.1:
  print(':(')
else:
  x = s // 1.08
  x = int(x)
  print(x)

Submission status: Runtime Error

Solution code:
N=1079

a = N/1.08

a1 = round(a)

a2 = int(a1*1.08)

if a2 == N:
    print(a1)
else:
    print(:()

Submission status: Runtime Error

Solution code:
N = int(input())

N//1.08 = X
M = X * 1.08

if M == N:
    print(X)
else:
    print(":(")

Submission status: Runtime Error

Solution code:
///                ..:: In The Name Of God ::..
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <list>
#include <queue>
#include <string>
#include <vector>
using namespace std;
//配列の要素数は　sizeof(ar)/sizeof(ar[0]) で求める
int N,M;
double X;
signed main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    X = ceil(N/(1.08));
    M = floor(X*(1.08));
    if(M == N){
        cout << X;
    }
    else{
        cout << ":(";
    }
}

Submission status: Runtime Error

Solution code:
def beforeTax(n):
  li = int(n // 1.08)
  if int(li * 1.08) == n:
    print(li)
  if int((li + 1) * 1.08) == n:
    print(li + 1)
  print(':(')
 
if __name__ == "__main__":
  import sys
  in_str = ''
  for line in sys.stdin:
    in_str += line
  n = [int(_) for _ in in_str.split()]
  print(int(beforeTax(n)))

Submission status: Runtime Error

Solution code:
import math
 
n = int(input())
answers = []

if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(i * 1.08) == n:
      answers.append(i)
  if len(answers) == 0:
    print(':(')
  if len(answers) == 1:
    print(answers[0])
  else:
    print(answers[len(answers) // 2])

Submission status: Runtime Error

Solution code:
N = int(input())

a = N/1.08

a1 = round(a)

a2 = int(a1*1.08)

if a2 == N:
    print(a1)
else:
    print(:()

Submission status: Runtime Error

Solution code:
import math
 
n = int(input())
answers = []

if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(i * 1.08) == n:
      answers.append(i)
      break
  else:
    print(':(')
  
  if len(answers) == 1:
    print(answers[0])
  else:
    print(answers[len(answers) // 2])

Submission status: Runtime Error

Solution code:
n = int(input())

x = n / 1.08

if round(x) * 1.08 == n:
  print(round(x))
else
  print(':(')

Submission status: Runtime Error

Solution code:
N = int(input())
if (N // 1.08) == ((N+1) //1.08) or int(n * 1.08) != N and N!=int( (n+1) * 1.08):
    print(':(')
else:
    print((N//1.08))

Submission status: Runtime Error

Solution code:
s = input()
s = int(s)

x = s / 1.08

rx = round(x)
tashikame = rx * 1.08
tashikames = math.floor(tashikame)
tashikames = int(tashikames)
if s != tashikames:
  print(':(')
else:
  x = int(x)
  print(x)

Submission status: Runtime Error

Solution code:
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

#a = list(map(int, input().split()))

n = int(input())

ans = [-1 for i in range(30002)]
for i in range(10001):
    price = int((i*1.08)//1)
    ans[price] = i

if(ans[n]!=-1):
    print(ans[n])
else:
    print(':(')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N = int(input())
X = floor(float(N/(1.08)))

if X==N:
    print(X)
else:
    print(":(")

Submission status: Runtime Error

Solution code:
import math
def main():
  N = int input()
  if (N < 1 || N > 50000):
    print(":(")
    return
  estimatedX1 = math.floor(N / 1.08)
  estimatedX2 = math.ceil(N / 1.08)
  
  if (round.floor(estimatedX1 * 1.08) == N):
    print(round.floor(estimatedX1 * 1.08))
  elif (round.floor(estimatedX2 * 1.08) == N):
    print(round.floor(estimatedX2 * 1.08))
  else:
    print(":(")

main()

Submission status: Runtime Error

Solution code:
s = input()
s = int(s)

x = s / 1.08

rx = round(x)
tashikame = rx * 1.08
tashikames = math.floor(tashikame)
tashikames = int(tashikames)
if s != tashikames:
  print(':(')
else:
  print(x)

Submission status: Runtime Error

Solution code:
N = map(int, input().split())
if int(N/(1.08))*1.08 == N:
  print(int(N/(1.08)))
else:
  print(":(")

Submission status: Runtime Error

Solution code:
s = input()
s = int(s)

x = s / 1.08

tashikame = round(x) * 1.08
tashikame = math.floor(tashikame)
if s != tashikame:
    print(':(')
else:
    print(x)

Submission status: Runtime Error

Solution code:
n = (int(i) for i in input().split()) 

if (n*100 // 108) == (n*100 / 108):
  print((n*100 // 108))
else:
  print(':(')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = map(int, input().split())
if float(N)+0.5 <= N*(100/108) and N*(100/108) <= float(N)+1.4:
  print(N*(100/108))
else:
  print(":(")

Submission status: Runtime Error

Solution code:
def check_untaxed_price(taxed_price, rate=1.08):
    X = taxed_price/rate
    c, f = np.ceil(X),np.floor(X)
    if int(c * rate)==taxed_price:
        return int(c)
    elif int(f * rate)==taxed_price:
        return int(f)
    else:
        return ":("

N = int(input())
print(check_untaxed_price(N))

Submission status: Runtime Error

Solution code:
n = (int(i) for i in input().split())  

if (n // 1.08) == (n % 1.08):
  print(int(n // 1.08))
else:
  print(':(')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E17;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////

int main(){fastio
    ll n;cin>>n;
    for(ll i=0;i<=50000;i++){
        ll x=i*108/100;
        if(x==n){
            cout<<x<<endl;return 0;
        }
    }
    cout<<":("<<endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
teika = input()
int_teika = int(teika)

int_motone = round(int_teika*100/108)
int_compared_motone = roundup(int_teika*100/108)
if int_motone == int_compared_motone:
  print(str(int_motone))
else:
  print(':(')

Submission status: Runtime Error

Solution code:
n = int(input())
import.math
for i in range(n):
  if int(i * 1.08) == n:
    print(i)
    exit()
  elif math.ceil(i * 1.08) == n:
    print(i)
    exit()
   

  
print(':(')

Submission status: Runtime Error

Solution code:
def check_untaxed_price(taxed_price, rate=1.08):
    X = taxed_price/rate
    c, f = np.ceil(X),np.floor(X)
    if int(c * rate)==taxed_price:
        return int(c)
    elif int(f * rate)==taxed_price:
        return int(c)
    else:
        return ":("

N = int(input())
print(check_untaxed_price(N))

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
n = input() 
x = (n * 100)/108
print(int(x))

Submission status: Runtime Error

Solution code:
n = input() 
x = (n * 100)/108
print(x)

Submission status: Runtime Error

Solution code:
import math
import sys

n = int(input())

start = math.floor(n // 1.09)
end = math.floor(n // 1.07)

for m in range(start, end):
  ma = math.floor(m * 1.08)
  if ma == n:
    print(m)
    sys.exit(1)

print(':(')

Submission status: Runtime Error

Solution code:
N = int(input())

n1 = N / 1.08

if round(n) == n:
    print(n)
else:
    print(":(")

Submission status: Runtime Error

Solution code:
import math
import sys

n = int(input())

start = math.floor(n // 1.1)

for m in range(start, n):
  ma = math.floor(m * 1.08)
  if ma == n:
    print(m)
    sys.exit(1)

print(':(')

Submission status: Runtime Error

Solution code:
n=int(input())
f=False
for i in range(1,5*10**4+1):
  if n==i*1.08//1
  	f=True
    
if f:
  print(i)
else:
  print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

for i in range(0.9*n//1, n):
  if (i * 1.08) // 1 == n:
    print(i)
    break
else:
  print(':(')

Submission status: Runtime Error

Solution code:
N=int(input())

X=math.ceil(N/1.08)
if X*1.08==N:
    print(int(X))
else:
    print(":(")

Submission status: Runtime Error

Solution code:
N=int(input())
for i in range(1,N//(1.08)+3): #X
  if int(i*1.08)==N:
    print(i)
    exit()
print(":(")

Submission status: Runtime Error

Solution code:
X = N / 1.08

Submission status: Runtime Error

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


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

print(':(')

Submission status: Runtime Error

Solution code:
import sys
n = int(input())
for i in range(n):
    if n <= i*1.08 <n+1:
        print(i)
        sys.exit()
print(:()

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(1, N):
    tmp = (i * 1.08) // 1
    if tmp == N:
        ans = i
        break
    elif tmp > N:
        ans = ':('
        break
print(ans)