Problem:


Score : 100 points

Problem Statement

You are parking at a parking lot. You can choose from the following two fee plans:

Plan 1: The fee will be A×T yen (the currency of Japan) when you park for T hours.

Plan 2: The fee will be B yen, regardless of the duration.

Find the minimum fee when you park for N hours.

Constraints

1≤N≤20

1≤A≤100

1≤B≤2000

All input values are integers.

Input

Input is given from Standard Input in the following format:

N A B

Output

When the minimum fee is x yen, print the value of x.

Sample Input 1

7 17 120

Sample Output 1

119

If you choose Plan 1, the fee will be 7×17=119 yen.

If you choose Plan 2, the fee will be 120 yen.

Thus, the minimum fee is 119 yen.

Sample Input 2

5 20 100

Sample Output 2

100

The fee might be the same in the two plans.

Sample Input 3

6 18 100

Sample Output 3

100



Sample input:
7 17 120


Sample output:
119

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split()),print(min(n*a,b))

Submission status: Runtime Error

Solution code:
print(min(int(input())*int(input()),int(input())))

Submission status: Runtime Error

Solution code:
n,a,b=map(input().split());print(min(n*a,b))

Submission status: Runtime Error

Solution code:
N,A,B=mp(int,input().split())
if N*A<=B:
  print(N*A)
else:
  print(B)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
s=N*A
t=B
if s>t:
  print(t)
else:
  prine(s)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
print(min(n*a, b))

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
print(min(n*a,b)

Submission status: Runtime Error

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

print(min(A*N),B)

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
res = min(n * a, b)
print(res)

Submission status: Runtime Error

Solution code:
X = input()
sum = 0

for i in range(len(x)):
  sum += int(x[i])
  
if int(x) % sum == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split());print(min[a*b,c])

Submission status: Runtime Error

Solution code:
N=(input())
print("Yes"if int(N)%(int(N[0])+int(N[1]))==0 else"No")

Submission status: Runtime Error

Solution code:
nab = list(int(i) for i in range(input().split()))
if nab[0] * nab[1] < nab[2]:
    print(nab[0] * nab[1])
else:
    print(nab[2])

Submission status: Runtime Error

Solution code:
s = list(map(int(input()).split()))
a = s[0]*s[1]
print(min(a,s[2]))

Submission status: Runtime Error

Solution code:
s = list(map(int.input().split()))
a = s[0]*s[1]
print(min(a,s[2]))

Submission status: Runtime Error

Solution code:
a,b,c = list(map(int, input().split()))
print(min(a*b), c)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N,A,B =map(int,input(),split())
if (A * N) > B:
  print(B)
else:
  print(A*N)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N,A,B =map(int,input(),split())
if (A * N) > B:
  print(B)
else:
  print(A*T)

Submission status: Runtime Error

Solution code:
list = [int(i) for i in input().split()]

fee = list[0] * list[1]

print(min(fee, list[2])

Submission status: Runtime Error

Solution code:
N, A, B = int(input())

if N * A >= B:
  print(B)
else:
  print(N * A)

Submission status: Runtime Error

Solution code:
from itertools import accumulate
N, C = map( int, input().split())
timetable = [ [0]*(10**5+2) for _ in range(C+1)]
for _ in range(N):
    s, t, c = map( int, input().split())
    timetable[c][s-1] += 1
    timetable[c][t] -= 1
for c in range(1,C+1):
    timetable[c] = list( accumulate(timetable[c]))
ans = 0
for i in range(1,10*5+1):
    now = 0
    for c in range(1,C+1):
        if timetable[c][i] > 0:
            now += 1
    ans = max( now, ans)
print(ans)

Submission status: Runtime Error

Solution code:
n,a,b = [int(i) for i in input().split()]
if (a＊n < b) :
  print(a＊n)
else :
  print(b)

Submission status: Runtime Error

Solution code:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Submission status: Runtime Error

Solution code:
n,a,b = map(int, input().split())
if a*n >= b:
    print(b)
else:
    print(

Submission status: Runtime Error

Solution code:
n,a,b=(int(i) for i in input().split(' '))
print(nin(a*n,b))

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
print(min([A * T, B]))

Submission status: Runtime Error

Solution code:
N, A, B = list(map(int, input().split()))
ans = max(A * T, B)

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
F = [list(map(int,input().split())) for i in range(N)]
P = [list(map(int,input().split())) for i in range(N)]

ans = -float('inf')
for k in range(1,1<<10):
    tmp = 0
    for fs,ps in zip(F,P):
        cnt = 0
        for b in range(10):
            if (k>>b)&1 and fs[b]:
                cnt += 1
        tmp += ps[cnt]
    ans = max(ans, tmp)
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c=int(input().split());print(min(a*b,c))

Submission status: Runtime Error

Solution code:
a,b,c=input().split();print(min(a*b,c))

Submission status: Runtime Error

Solution code:
a=input()
print("Yes"if int(a)%sum([int(a[i]) for i in range(len(a))])==0 else "No")

Submission status: Runtime Error

Solution code:
s=input();print("No"if int(s)%sum(map(int,s))else"Yes")

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
print(min(A*T,B))

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
print(min(N*a,B))

Submission status: Runtime Error

Solution code:
N, C = map(int, input().split())
r = [[0] * C for _ in range(10 * 5)]
for _ in range(N):
    s, t, c = map(int, input().split())
    for i in range(s - 1, t):
        r[i][c - 1] = 1
ans = 0
for t in r:
    sum_t = sum(t)
    if sum_t > ans:
        ans = sum_t

print(ans)

Submission status: Runtime Error

Solution code:
N,A,B=list(map(int,input().split()))
print(min(A*T, B))

Submission status: Runtime Error

Solution code:
N,A,B=list(map(int,inout().split()))
print(min(A*T, B))

Submission status: Runtime Error

Solution code:
n,a,b = split(input())
print (min(n*a,b))

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
print(a+b if a+B<=c else c)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input.split())
print(a+b if a+B<=c else c)

Submission status: Runtime Error

Solution code:
def cal(num):
  t = 0
  while num > 0:
    t += (num % 10)
    num //= 10
  return t
  
N = int(input(''))
total = cal(N)
if N % total == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
def cal(num):
  t = 0
  while num > 0:
    t += (num % 10)
    num //= 10
  return t
  
N = int(input(''))
total = cal(N)
if N % total == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
def ans():
    tmp = -9999999999999
    N = int(input())
    F = [list(map(int, input().split())) for i in range(N)]
    P = [list(map(int, input().split())) for i in range(N)]

    def calculate(B):
        v = []
        for n in range(N):
            mcnt = 0
            for k in range(10):
                if B[k] == '1' and F[n][k] == 1:
                    mcnt += 1
            v.append(P[n][mcnt])
        return sum(v)

    for i in range(1, 1 << 10):
        bi = bin(i)
        bi = bi[2:]
        bi = '0' * (10 - len(bi)) + bi
        tmp = max(tmp, calculate(bi))
    return print(tmp)


ans()

Submission status: Runtime Error

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

if int(A) * int(N) > int(B):
  print(B)
else:
  print(int(A) * int(N))

Submission status: Runtime Error

Solution code:
def smaller(int x, int y):
	if x < y: return x
	else: return y

inpt = map(int, raw_input())
n = inpt[0]
a = inpt[1]
b = inpt[2]

print smaller(n*a, b)

Submission status: Runtime Error

Solution code:
x,y,z=map(int,input().split())
print(x,y,z)
a[0]=z
a[1]=x*y
print(min(a))

Submission status: Runtime Error

Solution code:

n = int(input())
f = []
for _ in range(n):
    f.append(list(map(int, input().split())))
p = []
for _ in range(n):
    p.append(list(map(int, input().split())))

result = -100000000

# opening schedule for my shop.
# start from 1(only open Mon.AM) to 1023(open all day)
for b in range(1, 1<<10):

    profit = 0
    # compare with other shops
    for i in range(n):

        common_opening = 0
        # compare time
        for j in range(10):

            if 1&(b>>j) and f[i][j] == 1:
            
                common_opening += 1
        profit += p[i][common_opening]

    result = max(result, profit)

print(result)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input(),split())
d=a*b
if d<c:
  print(d)
else:
  print(c)

Submission status: Runtime Error

Solution code:
n,a,b = map(int, raw_input().split())
print(min(n*a, b))

Submission status: Runtime Error

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

print(min(n*a, b)

Submission status: Runtime Error

Solution code:
price = int(input()).split()
if  price > B:
  print(B)
else:
  print(N * A)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
if  price > B:
  print(B)
else:
  print(N * A)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
price =N * A
if  price > B:
  print(B)
else:
  print(price)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
price = N * A
if  price > B:
  print(B)
else:
  print(price)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
price =N * A
if  price > B:
  print(B)
else:
  print(price)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input())
print(min(N*A,B))

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
if ((N*A)>B):
  print(B)
elif:
  print(N*A)

Submission status: Runtime Error

Solution code:
A, B, C = map(int, raw_input().split())
if A * B < C:
  print(A*B)
else:
  print(C)

Submission status: Runtime Error

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

import sys

a, b = [int(e) for e in raw_input().split()]

ans = 'Even'
if (a & 1) and (b & 1):
    ans = 'Odd'
    
sys.stdout.write('%s\n' % (ans))
sys.stdout.flush()

Submission status: Runtime Error

Solution code:
import sys
args = sys.argv
Time = int(args[1])
A = int(args[2])
B = int(args[3])

if A*Time < B:
  print(A*Time)
else:
  print(B)

Submission status: Runtime Error

Solution code:
Time = int(input())
A = int(input())
B = int(input())

if A*Time < B:
  print(A*Time)
else:
  print(B)

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
if n*a>b:
  print(b)
else print(a)

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
f = np.zeros((n, 10), dtype=np.int64)
p = np.zeros((n, 11), dtype=np.int64)

for i in range(n):
  tmp = list(map(int, input().split()))
  for j in range(10):
      f[i][j] = tmp[j]
for i in range(n):
  tmp = list(map(int, input().split()))
  for j in range(11):
    p[i][j] = tmp[j]

r = -1e18
for b in range(1, 1<<10):
  s = 0
  for i in range(n):
    c = 0
    for j in range(10):
      if (b >> j) & 1 == 1 and f[i][j]:
        c += 1
    s += p[i][c]
  if r < s:
    r = s

print(r)

Submission status: Runtime Error

Solution code:
# A - Parking

N, A, B = map(int, raw_input().split)

print min(N*A, B)

Submission status: Runtime Error

Solution code:
# A - Parking

N, A, B = map(int, raw_input().split)

print mint(N*A, B)

Submission status: Runtime Error

Solution code:
import sys

t = sys.stdin.readline()
a = sys.stdin.readline()
b = sys.stdin.readline()

t1 = t.rstrip()
a1 = a.rstrip()
b1 = b.rstrip()

T = int(t1)
A = int(a1)
B = int(b1)


p1 = A*T

if B < p1:
    print(B)
elif B > p1:
    print(p1)
else:
    print(B)

Submission status: Runtime Error

Solution code:
import sys

a = sys.stdin.readline()
b = sys.stdin.readline()
t = sys.stdin.readline()

a1 = a.rstrip()
b1 = b.rstrip()
t1 = t.rstrip()

A = int(a1)
B = int(b1)
T = int(t1)

p1 = A*T

if B < p1:
    print(B)
elif B > p1:
    print(p1)
else:
    print(B)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n_shop = int(input())
i_schedule = []
i_benefit = []

max_profit = 0

#開店スケジュールを2進数→10進数に変換
for i in range(n_shop):
    i_schedule.append(int(input().replace(" ",""),2))
    
for i in range(n_shop):
    i_benefit.append(list(map(int,input().split())))
    max_profit += min(i_benefit[i])
    
#全パターンの開店スケジューるの作成
#一つ以上の時間帯で店は開店しなければならない

#schedule=[format(i, '010b') for i in range(1,1024)]
schedule = [i for  i in range(1,1024)]

#そこから一致数の計算→リストのcountメソッドを使う
for sch in schedule:
    anded = []
    for j in range(n_shop):
        anded.append(format(sch & i_schedule[j], "b").count("1"))     #一致スケジュールを2進数表記にして，1の数を計算
        
    profit = sum_benefit(anded)
    
    if max_profit <= profit:
        max_profit = profit
    
        
    

#最後に一致数から利益の計算
def sum_benefit(anded):
    summed= 0
    for shop in range(n_shop):
        sum += i_benefit[shop][anded[shop]]
    return summed

print(max_profit)

Submission status: Runtime Error

Solution code:

def binarize(txt):
    xs = txt.split(' ')
    xs = [int(x) for x in xs]
    b = 0
    for i in range(10):
        b += xs[i] * (2 ** i)
    return b


def count1(b):
    b = b[2:]
    count = 0
    for i in range(len(b)):
        if b[i] == '1':
            count += 1
    return count


N = input()
N = int(N)

F = [0 for i in range(N)]

for i in range(N):
    txt = input()
    F[i] = binarize(txt)


P = [[] for i in range(N)]

for i in range(N):
    xs = input().split(' ')
    P[i] = [int(x) for x in xs]


m = - 10 ** 11

for i in range(1, 2**10):

    score = 0

    for j in range(N):
        b = bin(i & F[j])
        count = count1(b)
        score += P[j][count]

    if score > m:
        m = score

print(m)

Submission status: Runtime Error

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

print(B if A*N < B else A*N)

Submission status: Runtime Error

Solution code:
#標準入力はN,A,Bで与えられる
numbers = int(input()).split()

for  i in range(len(numbers)):
    numbers[i] = int(numbers[i])

if numbers[0]*numbers[1] <= numbers[2]:
    print(numbers[0]*numbers[1])
else:
    print(numbers[2])

Submission status: Runtime Error

Solution code:
#標準入力はN,A,Bで与えられる
numbers = raw_input().split()

for  i in range(len(numbers)):
    numbers[i] = int(numbers[i])

if numbers[0]*numbers[1] <= numbers[2]:
    print(numbers[0]*numbers[1])
else:
    print(numbers[2])

Submission status: Runtime Error

Solution code:
x = input()
fxsum = sum(map(int, list(x))) 
if int(x)%fxsum==0:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

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

print(min(A*N, B))

Submission status: Runtime Error

Solution code:
def calcurate_digit_sum(num):
    num_str = str(num)
    digit_sum = 0
    for i, digit in enumerate(num_str):
        digit_sum += int(digit)

    return digit_sum

def check_harshad(num):
    digit_sum = calcurate_digit_sum(num)
    if num % digit_sum == 0:
        return("yes")
    return("no")

if __name__ == "__main__":
    N = int(input())
    print(check_harshad(N))

Submission status: Runtime Error

Solution code:
def calcurate_digit_sum(num):
    num_str = str(num)
    digit_sum = 0
    for i in num_str:
        digit_sum += int(i)

    return digit_sum

def check_harshad(num):
    digit_sum = calcurate_digit_sum(num)
    if num % digit_sum == 0:
        return("yes")
    return("no")

if __name__ == "__main__":
    N = int(input())
    print(check_harshad(N))

Submission status: Runtime Error

Solution code:
n = input()
if int(n) % sum(list(map(int, n))) == 0:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
priunt(min(a * n, b))

Submission status: Runtime Error

Solution code:
N,C=map(int,input().split())
imos=[0]*(10**5+1)
for i in range(N):
  s,t,c=map(int,input().split())
  imos[s-1]+=1
  imos[t]-=1
channels=[imos[0]]*(10**5+1)
for i in range(10**5):
  channels[i+1]=channels[i]+imos[i+1]
print(max(channels))

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
print (min(N*A,B))

Submission status: Runtime Error

Solution code:
X = int(input())
a = X
b = 0
while (a>10):
    b += (a % 10) + (X / 10)
if X % b == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 18 17:04:29 2017

@author: goto
"""

moji=map(int, input().split())

t=moji[0]*moji[1]
if t<moji[2]:
    minmoji=t
else:
    minmoji=moji[2]
    

print(minmoji)

Submission status: Runtime Error

Solution code:
st=input().split()
N=int(st[0]);A=int(st[1]);B=int(st[2])
print min([N*A,B])

Submission status: Runtime Error

Solution code:
st=input().split()
N=int(st[0]);A=int(st[1]);B=int(st[2])
print min(N*A,B)

Submission status: Runtime Error

Solution code:
st=input().split()
N=int(st[0]);A=int(st[1]);B=int(st[2])
print("{0}".format(min(A*N,B))

Submission status: Runtime Error

Solution code:
st=input().split()
N=int(st[0]);A=int(st[1]);B=int(st[2]);
print("{0}".format(min(A*N,B))

Submission status: Runtime Error

Solution code:
N=input()
T=0
for i in (N):
 T+=int(i)
if int(N)%T==0:
 print('Yes')
else:
 print('No')

Submission status: Runtime Error

Solution code:
N = input()
S = len(N)
f = 0
if int(N)==0:
    print("No")
else:
    for i in range(S) :
        f = f + int(N[i])

if int(N)%f==0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

import math

N = int(input())
_N = N

size = int (math.log10(N) + 1)

f = 0
while(size > 0):
    if(size > 1):
        f += int(N/(10**(size-1)))
        N %= 10**(size-1)
    else:
        f += N
    size -= 1

if(_N%f == 0):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

import math

N = int(input())
_N = N

size = int (math.log10(N) + 1)

f = 0
while(size > 0):
    if(size > 1):
        f += int(N/(10**(size-1)))
        # print(int(N/(10**(size-1))))
        N %= 10**(size-1)
    else:
        f += N
        # print(N)
    size -= 1

# print(_N, f, _N%f)

if(_N%f == 0):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N = input()
S = len(N)
sen = int(N) / 1000
hyaku =( int(N) - sen*1000 ) / 100
zyuu = (int(N) - sen*1000- hyaku*100) / 10
iti = int(N) - sen*1000- hyaku*100- zyuu*10

f = sen + hyaku + zyuu + iti

if int(N)%f==0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N=int(input()) A=int(input()) B=int(input())

v_fee=N*A
f_fee=B

data=[v_fee, f_fee]
dmin=min(data)

print(dmin)

Submission status: Runtime Error

Solution code:
import sys
n = int(sys.argv[1])
a = int(sys.argv[2])
b = int(sys.argv[3])
print(min(a*n, b))

Submission status: Runtime Error

Solution code:
N, A, B = input()
N = int(N)
A = int(A)
B = int(B)
priceA = A * N
if  priceA <= B:
    print(priceA)
else:
    print(B)

Submission status: Runtime Error

Solution code:
import sys
n = int(sys.argv[1])
a = int(sys.argv[2])
b = int(sys.argv[3])
print(min(a*n, b))

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
if N*A <B:
    print(N*A)
else:
    print(B)

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
print N*A if N*A < B else B

Submission status: Runtime Error

Solution code:
N, A, B = map(raw_input().split())
print N*A if N*A < B else B

Submission status: Runtime Error

Solution code:
N, A, B = map(input().split())
print(N*A if N*A < B else B)

Submission status: Runtime Error

Solution code:
N, A, B = map(input().split())
print N*A if N*A < B else B

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
print(min(a*b, c))