input stringlengths 20 127k | target stringlengths 20 119k | problem_id stringlengths 6 6 |
|---|---|---|
N = int(eval(input()))
A = list(map(int,input().split()))
ans = 1
if N % 2 == 1 and A.count(0) != 1:
ans = 0
if N % 2 == 1:
A.remove(0)
c = -1
if N % 2 == 0:
c = 1
else:
c = 2
for i in range(c, N, 2):
if A.count(i) != 2:
ans = 0
else:
ans *= 2
... | N = int(eval(input()))
A = list(map(int,input().split()))
ans = 1
A.sort()
if N % 2 == 1 and not A.count(0) == 1:
ans = 0
s = -1
if N % 2 == 1:
A.remove(0)
s = 2
else:
s = 1
for i in range(0, len(A), 2):
if A[i] == A[i + 1] == s:
ans *= 2
else:
ans = 0
... | p03848 |
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache
import heapq
class cin():
def int():
return int(sys.stdin.readline().rstrip())
def string():
return sys.stdin.readline().rstrip()
def ma... | # -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache
import heapq
class cin():
def int():
return int(sys.stdin.readline().rstrip())
def string():
return sys.stdin.readline().rstrip()
def ma... | p03848 |
import collections
n = int(eval(input()))
a = list(map(int, input().split()))
dd = collections.defaultdict(int)
correct = []
if n % 2 == 1:
correct.append(0)
for i in range((n - 1) // 2):
correct.append(2 * i + 2)
correct.append(2 * i + 2)
else:
correct.append(1)
correct.appe... | n = int(eval(input()))
a = list(map(int, input().split()))
a = sorted(a)
if n % 2 == 1:
if a[0] != 0:
print((0))
exit()
for i in range(1, n, 2):
if a[i] != a[i + 1] or a[i] != i + 1:
print((0))
exit()
else:
for i in range(0, n, 2):
if a[i]... | p03848 |
def main():
N = int(input())
A = [int(i) for i in input().split()]
MOD = 10**9 + 7
from collections import Counter
A_c = Counter(A)
for k,v in A_c.items():
if k == 0 and v != 1:
return print(0)
elif k != 0 and v != 2:
return print(0)
else:
... | def main():
N = int(input())
A = [int(i) for i in input().split()]
MOD = 10**9 + 7
from collections import Counter
c = Counter(A)
# print(c)
for k, v in c.items():
if k != 0 and v != 2:
return print(0)
if N & 1 and c[0] != 1:
return print(0)
... | p03848 |
from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
cntA = Counter(A)
if N % 2 == 0:
for i in range(1, N, 2):
if cntA[i] != 2:
print((0))
exit()
cntA[i] = 0
if max(cntA.values()) > 0:
print((... | from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
cntA = Counter(A)
if len(A) % 2 == 1:
if cntA[0] != 1:
print((0))
exit()
cnt = 1
for i in range(2, N, 2):
if cntA[i] != 2:
print((0))
exit()
cnt... | p03848 |
import sys
n = int(eval(input()))
a = list(map(int, input().split(' ')))
a.sort()
if n%2 == 0:
for i in range(n-1):
if i%2 == 0:
if a[i] == a[i+1]:
continue
else:
print((0))
sys.exit()
else:
if a[i]+2 ... | def main():
import sys
n = int(eval(input()))
a = list(map(int, input().split(' ')))
if n%2 == 1:
a.append(0)
a.sort()
for i in range(n-1):
if i%2 == 0:
if a[i] == a[i+1]:
continue
else:
print((0))
... | p03848 |
import sys
sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
if n % 2 != 0:
for i in range(n):
if i == 0:
if A[i] != 0:
print((0))
... | import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
if n % 2 == 0:
num = 1
for i in range(0, n - 1, 2):
if A[i] != num or A[i... | p03848 |
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
ans = 0
if N % 2 == 0:
for i in range(1, N, 2):
if A.count(i) != 2:
print((0))
exit()
print((2 ** (N // 2) % mod))
else:
for i in range(2, N, 2):
if A.count(i) != 2:
... | N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
mod = 10 ** 9 + 7
ans = 0
B = []
if N % 2 == 0:
for i in range(1, N, 2):
B.append(i)
B.append(i)
else:
B.append(0)
for i in range(2, N, 2):
B.append(i)
B.append(i)
if A == B:
print((2 **... | p03848 |
a = int(eval(input()))
b = list(map(int, input().split()))
b.sort()
c = 1 if a % 2 == 0 else 0
for i in range(a):
if (a % 2) ^ (i % 2) == 0 and i != 0:
c += 2
if b[i] != c:
print((0))
exit()
print(((2 ** (a // 2)) % (10 ** 9 + 7)))
| a = int(eval(input()))
b = list(map(int, input().split()))
b.sort()
if a % 2 == 0:
c = 1
for i in range(len(b)):
if i > 0 and i % 2 == 0:
c += 2
if b[i] != c:
print((0))
exit()
print(((2 ** (a // 2)) % (10 ** 9 + 7)))
else:
c = 0
for ... | p03848 |
N = int(eval(input()))
A = list(map(int, input().split()))
if N & 1:
if A.count(0) == 1:
for i in range(2,N,2):
if A.count(i)!=2:
print((0))
exit()
else:
print((0))
exit()
else:
for i in range(1, N, 2):
if A.count(i) !=... | N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
if N & 1:
if A[0] == 0:
for i in range(1, N, 2):
if A[i] != (i+1):
print((0))
exit()
else:
print((0))
exit()
else:
for i in range(0, N, 2):
if A[i] !=... | p03848 |
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list([x-1 for x in MII()])
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _... | import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list([x-1 for x in MII()])
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _... | p03848 |
import math
from collections import Counter
n = int(eval(input()))
lis = list(map(str,input().split()))
if n % 2 == 1:
for i in range(math.ceil(n / 2)):
if i == 0:
if lis.count("0") != 1:
print("0")
exit()
else:
if lis.count(str(i * 2)) != 2:
print("0")
... | import math
n = int(eval(input()))
lis = list(map(int,input().split()))
li = [0 for _ in range(math.ceil(n / 2))]
for i in range(n):
li[math.floor(lis[i] / 2)] += 1
for i in range(len(li)):
if n % 2 == 1 and i == 0:
if li[i] != 1:
print("0")
exit()
else:
if li[i] != 2:
pri... | p03848 |
from collections import Counter
n = int(eval(input()))
lis = list(map(int,input().split()))
if n % 2 == 0:key = 1
else:key = 2
for i in range(n//2):
if lis.count(i*2+key) != 2:
print("0")
exit()
if n % 2 == 1:
if lis.count(0) != 1:
print("0")
exit()
print((2 ** (n//2... | n = int(eval(input()))
lis = list(map(int,input().split()))
lis.sort()
if n % 2 == 1:
if lis[0] != 0:
print("0")
exit()
else:key = 0
else:key = -1
for i in range(n//2):
if lis[i*2+key+1] != lis[i*2+key+2] or lis[i*2+key+2] != 2*(i+1) + key:
print("0")
exit()
ans ... | p03848 |
N=int(eval(input()))
A=list(map(int,input().split()))
A.sort()
B=[]#偶数だけ
C=[]#奇数だけ
if N%2==0:
for i in range(0,int(N/2)):
B+=[2*i,2*i]
C+=[2*i+1,2*i+1]
if A==B or A==C:
n=int(N/2)
ans=2**n
print((ans%(10**9+7)))
else:
print((0))
else:
B+=[0]
C+=[1]
for i in range(... | def power_func(a,n,p):
bi=str(format(n,"b"))#2進表現に
res=1
for i in range(len(bi)):
res=(res*res) %p
if bi[i]=="1":
res=(res*a) %p
return res
MOD = 10**9+7
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
if N%2:
correct = [0]
for i in range(N//2):
corre... | p03848 |
N = int(eval(input()))
A = [int(i) for i in input().split()]
if N % 2 == 1:
for i in range(N // 2):
if A.count(i * 2) != 2 and i != 0:
print((0))
exit()
if i == 0 and A.count(i) != 1:
print((0))
exit()
if N % 2 == 0:
for i in range(N... | N = int(eval(input()))
A = [int(i) for i in input().split()]
check = True
A = sorted(A)
if N % 2 == 0:
for i in range(N):
if i % 2 == 0 and A[i] != i + 1:
check = False
if i % 2 == 1 and A[i] != i:
check = False
if N % 2 != 0:
for i in range(N):
if... | p03848 |
def slove():
import sys
input = sys.stdin.readline
n = int(input().rstrip('\n'))
a = list(map(int, input().rstrip('\n').split()))
a.sort()
if a[0] == 0:
t = 2
for i in range(2, n, 2):
if a[i] != a[i-1] or a[i] != t:
print((0))
... | import sys
def solve():
readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n = int(readline())
a = list(map(int, readline().split()))
a.sort()
t = 0
if n % 2 == 0:
t = 1
for i in range(n):
if i % 2 == n % 2 and i != 0:
t += 2
if a[... | p03848 |
from collections import Counter
N = int(eval(input()))
AC = Counter(list(map(int, input().split())))
if N % 2 == 1:
if N == 1:
ans = AC[0] == 1
else:
ans = AC[0] == 1
for k, v in AC.most_common(N//2):
if k > N-1 or k % 2 != 0 or v != 2:
ans = False
... | from collections import Counter
N = int(eval(input()))
Alist = list(map(int, input().split()))
Ac = Counter(Alist)
mod = 10**9+7
if N%2==0:
for i in range(1, N, 2):
if Ac[i] != 2:
print((0))
break
else:
print((pow(2, (N//2), mod)))
else:
if Ac[0] != 1:
... | p03848 |
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
if N % 2 == 1:
if A[0] != 0:
print((0))
exit()
for i in range(N // 2):
if A[2 * i + 1] != 2 * (i + 1) or A[2 * i + 2] != 2 * (i + 1):
print((0))
exit()
print((pow(2, N // 2) % (10 *... | n=int(eval(input()))
a=list(map(int,input().split()))
a.sort()
if n%2==1:
if a[0]!=0:
print((0))
exit()
for i in range(n//2):
if a[2*i+1]!=2*(i+1) or a[2*(i+1)]!=2*(i+1):
print((0))
exit()
print((pow(2,n//2)%(10**9+7)))
else:
for i in range(n/... | p03848 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from collections import Counter
import sys
N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
A = Counter(A)
if N % 2 == 1:
for num, cnt in list(A.items()):
# print(num, cnt)
if num == 0:
if cnt != 1:
... | from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
# N = 5
# A = [2, 4, 4, 0, 2]
mod = 10 ** 9 + 7
cnt = Counter(A)
if N % 2 == 0:
if len(list([c for c in list(cnt.values()) if c != 2])) != 0:
print((0))
else:
print(((2 ** (N // 2)) % mod))
... | p03848 |
n = int(eval(input()))
a = list(map(int,input().split()))
if n % 2 == 0:
b = 0
for i in range(n//2):
if a.count(i*2+1) != 2:
b = 1
if b == 1:
print((0))
else:
print((2**(n//2)))
else:
b = 0
if a.count(0) != 1:
b = 1
else:
... | n = int(eval(input()))
a = list(map(int,input().split()))
a.sort()
if n % 2 == 0:
b = 0
for i in range(0,n,2):
if a[i] != a[i+1] and a[i] != i+1:
b = 1
if b == 1:
print((0))
else:
print(((2**(n//2))%1000000007))
else:
b = 0
if a[0] != 0:
... | p03848 |
#! /usr/bin/env python3
D = 10**9+7
N = int(eval(input()))
A = list(map(int, input().split()))
M = N%2>0
b = 1
if M:
if A.count(0) != 1 : b = 0
for i in range(2, N, 2):
if A.count(i) != 2 : b = 0
else:
for i in range(1, N, 2):
if A.count(i) != 2 : b = 0
print(((2**(N//2))%... | #! /usr/bin/env python3
D = 10**9+7
N = int(eval(input()))
A = list(map(int, input().split()))
M = N%2>0
b = 1
C = [0] * (N//2+1)
if M:
for i in A:
if i%2 < 1:
C[i//2] += 1
b = (N//2) == sum(1 for x in C[1:] if x == 2) and C[0] == 1
else:
for i in A:
if i%2... | p03848 |
from collections import Counter
N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10 ** 9 + 7
x = N // 2
ans = pow(2, x, mod)
c = Counter(A)
if N & 1:
for i in range(0, N, 2):
if i == 0 and c[i] == 1:
continue
if c[i] == 2:
continue
ans... | from collections import Counter
mod = 10 ** 9 + 7
def main():
N = int(eval(input()))
A = list(map(int, input().split()))
C = Counter(A)
# check
if N % 2 == 1:
if C[0] != 1:
return 0
for i in range(2, N, 2):
if C[i] != 2:
retur... | p03848 |
from math import floor
a, b, n = list(map(int, input().split()))
# a, b, n = 4628, 3261783, 3421
max_num = -99999999999999999999999
for i in range(n):
x = i + 1
num = floor(a*x / b) - a * floor(x / b)
if num > max_num:
max_num = num
print(max_num) | from math import floor
a, b, n = list(map(int, input().split()))
x = min(n, b-1)
if x < 0:
x = 0
print((floor(a*x / b) - a * floor(x / b))) | p02696 |
A,B,N = list(map(int,input().split()))
tmp=0
for i in range(0,N+1):
floor = (A*i)//B-A*(i//B)
if floor>tmp:
tmp = floor
print(tmp) | import math
A,B,N = list(map(int,input().split()))
if B-1>N:
print((math.floor((A*N)/B)-A*math.floor(N/B)))
else:
print((math.floor((A*(B-1))/B)-A*math.floor((B-1)/B))) | p02696 |
from math import floor
A, B, N = list(map(int, input().split()))
f = 0
for k in range(0, (N+1)//B + 1):
x = (k+1)*B - 1
if x > N:
x = N
func = floor(A*x/B) - A * floor(x/B)
f = max(func, f)
print(f)
| from math import floor
A, B, N = list(map(int, input().split()))
x = min(B-1, N)
ans = floor(A*x/B) - A*floor(x/B)
print(ans) | p02696 |
import math
a, b, n = list(map(int,input().split()))
ans = 0
m = math.floor(n/10)
for i in range(m,n+1):
s = math.floor(a * i / b)
t = math.floor (i/b)
ans = max(ans,s - a*t)
print(ans) | a, b, n = list(map(int,input().split()))
ans = 0
x = min(n , b-1)
print((x*a //b)) | p02696 |
a,b,n=list(map(int,input().split()))
ans=0
x=0
y=0
# while(x<=n or y<=n):
# ans=max(ans,((a*x)//b - a*(x//b)),((a*y)//b - a*(y//b)))
# x+=b
# y=-(-x//a)
for i in range(n+1):
ans=max(ans,((a*i)//b - a*(i//b)))
print(ans)
| a,b,n=list(map(int,input().split()))
def f(x):
return (a*x)//b - a*(x//b)
print((f(min(b-1,n)))) | p02696 |
import math
import sys
A,B,N=list(map(int, input().split()))
NUM=0
if N<B:
NUM=math.floor(A*N/B)-A*math.floor(N/B)
print(NUM)
sys.exit()
else:
if A>B:
for x in range(N+1,math.floor(N/4),-1):
TGT=math.floor(A*x/B)-A*math.floor(x/B)
if TGT>NUM:
... | A,B,N = (list(map(int , input().split())))
min(B-1,N)
x = min(B-1,N)
print(((A*x)//B - A * (x//B))) | p02696 |
import math
A, B, N = list(map(int, input().split(' ')))
_max = 0
for x in range(N, int(N/2), -1):
if x < 1:
break
num =math.floor(A * x / B) - A * math.floor(x/B)
# print(num)
if num > _max:
_max = num
print(_max)
| import math
def floor(A, B, x):
return math.floor(A * x / B) - A * math.floor(x/B)
A, B, N = list(map(int, input().split(' ')))
x = min(N, B-1)
print((floor(A,B,x)))
| p02696 |
A,B,N=list(map(int,input().split()))
maxP=-10**15
if N<100000000:
for i in range(1,N+1):
tmp=(A*i)//B-A*(i//B)
if maxP<tmp:
maxP=tmp
else:
for i in range(1,10000000):
tmp=(A*i)//B-A*(i//B)
if maxP<tmp:
maxP=tmp
for i in range(... | A,B,N=list(map(int,input().split()))
i=min(B-1,N)
tmp=(A*i)//B-A*(i//B)
print(tmp) | p02696 |
a, b, n = list(map(int, input().split()))
ans = 0
for x in range(1, min(b,n) + 1):
fx = int(a*x/b) - a * int(x/b)
if ans < fx:
ans = fx
print(ans) | a, b, n = list(map(int, input().split()))
y = 0
if n >= b:
y = b - 1
else:
y = n
print((int(a*y/b))) | p02696 |
[A,B,N] = list(map(int,input().split()))
x=N
dammy=[]
while x > N//(1.1):
dammy.append((A*x)//B - A * int(x/B))
x = x -1
print((max(dammy)))
| [A,B,N] = list(map(int,input().split()))
W = N//B
dammy=[]
x=N
dammy.append((A*x)//B - A * int(x/B))
x=(B * W)-1
dammy.append((A*x)//B - A * int(x/B))
print((max(dammy))) | p02696 |
from sys import stdin, stdout
from collections import defaultdict
import math
from queue import Queue
a, b, n = list(map(int, stdin.readline().strip().split()))
x = min(b - 1, n)
ans = math.floor(a * x / b) - a * math.floor(x / b)
stdout.writelines(str(ans) + '\n')
| import math
def eq_value(a, b, x):
return math.floor(a * x / b) - a * math.floor(x / b)
A, B, n = list(map(int, input().split()))
print((eq_value(A, B, min(B-1, n))))
| p02696 |
import math
a,b,n = list(map(int,input().split()))
m = 0
x = 1
ax = a*x
while ax/b <0.01:
x*=10
ax = a*x
if x>n:
x//10
break
if a-b==1:
print(n)
elif b-a==1:
print((n-1))
else:
for i in range(x,n+1):
ch = math.floor(a*i/b)-a*math.floor(i/b)
m = m... | import math
a,b,n = list(map(int,input().split()))
x = min(b-1,n)
print((math.floor(a*x/b)-a*math.floor(x/b))) | p02696 |
A,B,N= list(map(int, input().split()))
ma=0
for i in range(1,min(N,B)+1):
a=int(A*i/B)-A*int(i/B)
if(ma<a):
ma=a
if(a>=A):
break
print(ma) | A,B,N= list(map(int, input().split()))
print((int(A*min(B-1,N)/B)-A*int(min(B-1,N)/B))) | p02696 |
from math import floor
def f(x, a, b):
return floor((x * a) / b) - a * floor(x / b)
def main():
a, b, n = list(map(int, input().split()))
if n < min(a, b):
print((f(n, a, b)))
elif min(a, b) <= n < max(a, b):
print((max(f(min(a, b) - 1, a, b), f(n, a, b))))
else:
... | from math import floor
def main():
a, b, n = list(map(int, input().split()))
def f(x):
return floor((x * a) / b) - a * floor(x / b)
print((f(min(n, b - 1))))
if __name__ == '__main__':
main()
| p02696 |
"""
=int(input())
=map(int,input().split())
=list(map(int,input().split()))
# アレイ import numpy as np =np.array(list(map(float,input().split())))
# 文字列 =list(str(input()).split(" " or ","))
# 一文字&連番(縦横可能) =map(int, open(0).read().split())
# 2-d list
lis=[[] for _ in range(M)]
for i in range(M):
l... | a, b, n = list(map(int, input().split()))
x = min(b - 1, n) # b-1がいいけど、上限 nの制約あり
ans = int(a * x / b)
print(ans) | p02696 |
a, b, x = list(map(int, input().split()))
o = x
x = max(0, x - 10000000)
m = 0
while x <= o:
r = max(0, o - x)
m = max(m, (a*x) // b - a * (x // b))
m = max(m, (a*r) // b - a * (r // b))
x += 1
print(m) | a, b, x = list(map(int, input().split()))
o = x
x = max(0, x - 2000000)
m = 0
while x <= o:
r = max(0, o - x)
m = max(m, (a*x) // b - a * (x // b))
m = max(m, (a*r) // b - a * (r // b))
x += 1
print(m) | p02696 |
def floor(x):
return int(x)
a,b,n=list(map(int,input().split()))
if b<n:
m=floor((a*(b-1)/b))
for i in range(b,n+1):
tmp=floor(a*i/b)-(floor(i/b)*a)
if tmp>m:
m=tmp
print(m)
else:
m=0
for i in range(1,n+1):
tmp=floor(a*i/b)-(floor(i/b)*a)
... | a,b,n=list(map(int,input().split()))
m=min(n,b-1)
tmp=(a*m//b)-((m//b)*a)
print(tmp) | p02696 |
a,b,n=list(map(int,input().split()))
ans=0
for i in range(n+1):
ans=max(ans,int((a*i)/b)-a*int(i/b))
print(ans) | a,b,n=list(map(int,input().split()))
k=min(n,b-1)
print((int((a*k)/b)-a*int(k/b)))
| p02696 |
a, b, n = list(map(int, input().split()))
ans = 0
if b > n:
x = n
ans = int(a * x // b) - int(a * (x // b))
else:
m = 0
for i in range(b):
if int(a * (n - i) // b) - int(a * ((n - i) // b)) > m:
m = int(a * (n - i) // b) - int(a * ((n - i) // b))
ans = m
print(ans)
| a, b, n = list(map(int, input().split()))
ans = 0
if b > n:
x = n
ans = int(a * x // b) - int(a * (x // b))
else:
x = n
ans1 = int(a * x // b) - int(a * (x // b))
x = (n//b)*b-1
ans2 = int(a * x // b) - int(a * (x // b))
ans = max(ans1,ans2)
print(ans)
| p02696 |
a, b, n = list(map(int, input().split()))
ans = 0
for i in range(n + 1):
floor = int(a * i / b) - a * int(i / b)
ans = max(ans,floor)
print(ans) | a, b, n = list(map(int, input().split()))
x = min(n, b - 1)
ans = int(a * x / b) - a * int(x / b)
print(ans) | p02696 |
import sys,os
from collections import defaultdict, deque
from math import ceil, floor
if sys.version_info[1] >= 5:
from math import gcd
else:
from fractions import gcd
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else... | import sys,os
from collections import defaultdict, deque
from math import ceil, floor
if sys.version_info[1] >= 5:
from math import gcd
else:
from fractions import gcd
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else... | p02696 |
from sys import stdin
input = stdin.readline
a,b,n = list(map(int,input().split()))
maxpoint = 0
if b > n :
tmp = int((a * n) / b) - a * int(n/b)
maxpoint = max(tmp,maxpoint)
else:
for i in reversed(list(range(n+1))):
tmp = int((a * i) / b) - a * int(i/b)
if b > 1:
... | from sys import stdin
input = stdin.readline
a,b,n = list(map(int,input().split()))
maxpoint = 0
if b > n :
tmp = int((a * n) / b) - a * int(n/b)
maxpoint = max(tmp,maxpoint)
else:
k = int(n/b)*b -1
maxpoint = int((a * k) / b) - a * int(k/b)
if b == 1:
maxpoint = 0
... | p02696 |
import math
a, b, n = list(map(int, input().split()))
ma = -1
for x in range(n, -1, -1):
tmp = math.floor(a*x/b) - a*math.floor(x/b)
if ma < tmp:
ma = tmp
print(ma) | import math
a, b, n = list(map(int, input().split()))
def f(x):
return math.floor(a*x/b) - a*math.floor(x/b)
print((f(min(b-1, n)))) | p02696 |
A, B, N = list(map(int, input().split()))
x = min(B - 1, N)
print(((A * x) // B - A * (x // B)))
|
A, B, N = list(map(int, input().split()))
if N >= B:
print((A * (B - 1) // B))
else:
print((A * N // B))
| p02696 |
import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
C = B+1
else:
C = N
for i in range(1, C+1):
val = math.floor(A*i/B) - A*math.floor(i/B)
ans = max(ans, val)
print(ans)
| import math
A, B, N = list(map(int, input().split()))
ans = 0
if B+1 < N:
C = B+1
else:
C = N
if B//A == 0:
D = 1
elif B//A > 1:
D = B//A-1
else:
D = B//A
for i in range(1, C+1, D):
val = math.floor(A*i/B) - A*math.floor(i/B)
#print("i", i, "val", val)
ans = max(ans, val)
... | p02696 |
a, b, n = list(map(int, input().split()))
ans = 0
for x in range(n+1):
y = int(a * x / b) - a * int(x / b)
if x == 0 or y > ans:
ans = y
print(ans)
| a, b, n = list(map(int, input().split()))
def floor(x):
return int(a * x / b) - a * int(x / b)
if n >= b-1:
ans = floor(b-1)
else:
ans = floor(n)
print(ans)
| p02696 |
a,b,n=list(map(int,input().split()))
l=[]
for i in range(1,n+1):
m=(a*i//b)-a*(i//b)
l.append(m)
print((max(l))) | a,b,n=list(map(int,input().split()))
x=min(n,b-1)
print((a*x//b)) | p02696 |
a,b,n=list(map(int,input().split()))
x=(a*1)//b-a*(1//b)
for i in range(1,n+1):
x=max(x,(a*i)//b-a*(i//b))
print(x) | a,b,n=list(map(int,input().split()))
if b>n:
print(((a*n)//b-a*(n//b)))
else:
print((a*(b-1)//b-a*((b-1)//b))) | p02696 |
A, B, N = list(map(int, input().split()))
# x=0の場合、値は0
ans = 0
# x=1~Nについて
for x in range(1, min(B+1,N+1)):
if (A*x)//B - A*(x//B) > ans:
ans = (A*x)//B - A*(x//B)
print(ans) | A, B, N = list(map(int, input().split()))
if N>=B:
print((A*(B-1)//B))
else:
print((A*N//B)) | p02696 |
from math import floor
def main():
a, b, n = list(map(int, input().split()))
r = 0
for i in range(n+1):
r = max(r, floor(a*i/b) - floor(i/b)*a)
print(r)
if __name__ == '__main__':
main()
| from math import floor
def main():
a, b, n= list(map(int, input().split()))
x = min(n, b - 1)
r = floor((a * x) / b) - a * floor(x / b)
print(r)
if __name__ == '__main__':
main()
| p02696 |
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import floor
def main():
a, b, n = list(map(int, input().split()))
amariset = set()
for i1 in range(1, n + 1):
amari = (i1 / b) % 1
if amari in amariset:
break
else:
amari... | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import floor
def main():
a, b, n = list(map(int, input().split()))
if n < b:
x = n
else:
x = b - 1
r = floor(a * x / b) - a * floor(x / b)
print(r)
if __name__ == '__main__':
main()
| p02696 |
a,b,n = list(map(int,input().split()))
p = (n+1)//b
c = p*b-1
if c < 0:
print((a*n//b-a*(n//b)))
exit()
ans = 0
for i in range(c,n+1):
ans = max(ans,a*i//b-a*(i//b))
print(ans) | a,b,n = list(map(int,input().split()))
p = (n+1)//b
c = p*b-1
if c < 0:
print((a*n//b-a*(n//b)))
exit()
ans = max(a*n//b-a*(n//b),a*c//b-a*(c//b))
print(ans) | p02696 |
import sys
import os
def file_input():
f = open('../Beginner_Contest_165/input.txt', 'r')
sys.stdin = f
def main():
#file_input()
# input()
A,B,N=list(map(int, input().split()))
max=0
# for x in range(N+1):
# # ans=int(A*x/B)-A*int(x/B)
# min,_=math.modf(x/B... | import sys
import os
def file_input():
f = open('../Beginner_Contest_165/input.txt', 'r')
sys.stdin = f
def main():
# file_input()
# input()
A,B,N=list(map(int, input().split()))
max=0
# for x in range(N+1):
# # ans=int(A*x/B)-A*int(x/B)
# min,_=math.modf(x/B... | p02696 |
from copy import deepcopy
a,b,n = [int(i) for i in input().split()]
score = 0
if a * n / b < 1:
print((0))
exit()
for i in range(n+1):
tmp = int(a * i / b) - a * int(i / b)
if score <= tmp:
score = deepcopy(tmp)
else:
print(score)
exit()
print(score) |
a,b,n = [int(i) for i in input().split()]
score = 0
if n < b:
print((int(a * n / b) - a * int(n / b)))
else:
n = b-1
print((int(a * n / b) - a * int(n / b))) | p02696 |
import math
a, b, n = list(map(int, input().split()))
ans = 0
for i in range(1, n+1):
ans = max(ans, math.floor(a*i/b) - a * math.floor(i/b))
print(ans) | def f(a, b, n):
return int(a*n/b) - a*int(n/b)
a, b, n = list(map(int, input().split()))
print((f(a, b, b-1) if n >= b-1 else f(a, b, n)))
| p02696 |
a, b, n = list(map(int, input().split()))
tmp = 0
for x in (list(range(1, b+1, 2)) if b<=n else list(range(1, n+1, n-1))):
#for x in range(1, n+1):
calc = a*x//b - a*(x//b)
if calc > tmp:
tmp = calc
print(tmp) | a, b, n = list(map(int, input().split()))
tmp = 0
for x in (list(range(1, b+1, b-2)) if b<=n else list(range(1, n+1, n-1))):
#for x in range(1, n+1):
calc = a*x//b - a*(x//b)
if calc > tmp:
tmp = calc
print(tmp) | p02696 |
# -*- coding: utf-8 -*-
A,B,N = list(map(int, input().split()))
z = 0
if N > B:
for x in range(1,B+1):
ans = (x % B) / B * A
if ans > z:
z = ans
else:
for x in range(1,N+1):
ans = (x % B) / B * A
if ans > z:
z = ans
print((int(z))) | # -*- coding: utf-8 -*-
A,B,N = list(map(int, input().split()))
if N >= B:
x = B - 1
z = (A * x) // B - A * (x // B)
else:
x = N
z = (A * x) // B - A * (x // B)
print((int(z))) | p02696 |
a,b,n = list(map(int,input().split()))
ma = 0
if(n<b):
ma = (a*n)//b - (a* (n//b))
else:
ma = (a*(b-1))//b - (a*((b-1)//b))
for x in range(b,n+1):
num = (a*x)//b - (a*(x//b))
if(ma > num):
break
ma = num
print(ma) | a,b,n = list(map(int,input().split()))
ma = 0
if(n<b):
ma = (a*n)//b - (a* (n//b))
else:
ma = (a*(b-1))//b - (a*((b-1)//b))
"""
for x in range(b,n+1):
num = (a*x)//b - (a*(x//b))
if(ma > num):
break
ma = num
"""
print(ma) | p02696 |
from math import floor
a,b,n = list(map(int,input().split()))
ans=0
for i in range(n+1):
ans = max(ans, floor(a*i/b)-a*floor(i/b))
print(ans) | from math import floor
a,b,n = list(map(int,input().split()))
x=min(b-1,n)
print((floor(a*x/b)-a*floor(x/b))) | p02696 |
a,b,n=list(map(int,input().split()))
ans=0
for x in range(0,min(b,n+1)):
ans=max(ans, int(a*x*1.0/b)-a*int(x*1.0/b))
print(ans) | a,b,n=list(map(int,input().split()))
print((int(a*min(b-1,n)/b))) | p02696 |
A, B, N = list(map(int, input().split()))
ans = []
for x in range(N+1):
a = int(A * x / B) - A * int(x / B)
ans.append(a)
print((max(ans))) | A, B, N = list(map(int, input().split()))
if N < B:
ans = int(A * N / B) - A * int(N / B)
else:
ans = int((B - 1) / B * A)
print(ans) | p02696 |
"""
- floor function
"""
a,b,n=list(map(int,input().split()))
x=min(n,b-1)
print(((a*x)//b-a*(x//b))) | """
- floor function
- xは(0<=x<=B-1 && x<=N)を満たす最大数
"""
a,b,n=list(map(int,input().split()))
x=min(n,b-1)
print(((a*x)//b-a*(x//b))) | p02696 |
# coding: utf-8
import math
A, B, N = list(map(int, input().split()))
tmp = 0
ans = 0
for i in range(1, N+1):
tmp = math.floor(A * i / B) - A * math.floor(i / B)
ans = max(tmp, ans)
print(ans) | # coding: utf-8
A, B, N = list(map(int, input().split()))
num = min(B-1, N)
print((A * num // B - A * (num // B))) | p02696 |
a,b,n=list(map(int,input().split()))
ans=-10**9
if a==1 or b==1:
print((0))
else:
for i in range(1,n+1):
tmp=int(a*i/b)-a*int(i/b)
if tmp<ans:
break
else:
ans=tmp
print(ans) | a,b,n=list(map(int,input().split()))
i=min(n,b-1)
print((int(a*i/b)-a*int(i/b))) | p02696 |
a, b, n = list(map(int, input().split()))
ans = 0
zero_cnt = 0
for i in range(n+1):
tmp = int(a*i/b) - a*int(i/b)
if ans != 0 and tmp == 0:
break
ans = max(ans, tmp)
print(ans) | a, b, n = list(map(int, input().split()))
x = min(b-1, n)
print((int(a*x/b))) | p02696 |
a,b,n = list(map(int, input().split()))
ans = 0
p = int(pow(n,0.5))
for x in range(n,p,-1):
ans = max(int(a*x/b) - (a*int(x/b)),ans)
print(ans) | a, b, n = list(map(int,input().split()))
x = min(n,b-1)
print((int(a*(x%b) / b))) | p02696 |
A, B, N = list(map(int,input().split()))
List = [int(A*i/B)-A*int(i/B) for i in range(N+1)]
print((max(List))) | A, B, N = list(map(int,input().split()))
C = min([N,B-1])
ans = int(A*C/B)
print(ans)
| p02696 |
A, B, N = list(map(int,input().split()))
C = min([N,B-1])
ans = int(A*C/B)
print(ans)
| A, B, N = list(map(int,input().split()))
print((int(A*min([N,B-1])/B)))
| p02696 |
import math
a,b,n=list(map(int,input().split()))
l=[i/b for i in range(1,n+1)]
m=[math.floor(a*s)-a*math.floor(s) for s in l]
print((max(m))) |
a,b,n=list(map(int,input().split()))
m=0
for i in range(1,n+1):
s=i/b
num=int(a*s)
num-=a*int(s)
if num>=m:
m=num
print(m) | p02696 |
a,b,n=list(map(int,input().split()))
m=0
for i in range(1,n+1):
s=i/b
num=int(a*s)
num-=a*int(s)
if num>=m:
m=num
print(m) | a,b,n=list(map(int,input().split()))
if b>n:
print((int(a*n/b)-a*int(n/b)))
else:
print((int(a*(b-1)/b)-a*int((b-1)/b))) | p02696 |
#!/usr/bin python3
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
def main():
A, B, N = list(map(int, input().split()))
N = min(B-1, N)
ret = 0
for x in range(N+1):
ret = max(ret, (x * A)//B - A * (x//B))
print(ret)
if __name__ == '__main__':
main() | #!/usr/bin python3
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
def main():
A, B, N = list(map(int, input().split()))
N = min(B-1, N)
ret = (N * A)//B - A * (N//B)
print(ret)
if __name__ == '__main__':
main() | p02696 |
import math
A, B, N = list(map(int, input().split()))
ans = 0
for i in range(N+1):
ans=max(ans, math.floor(A*i/B)-A*math.floor(i/B))
print(ans)
| import math
A, B, N = list(map(int, input().split()))
x = N
if (N >= B-1): x = B-1
ans = A*(x%B)//B
print(ans)
| p02696 |
A,B,N=list(map(int,input().split()))
import math
ans=[]
for i in range(1,N+1):
ans.append(math.floor(A*i/B)-A*math.floor(i/B))
print((max(ans))) | A,B,N=list(map(int,input().split()))
import math
if N<B:
print((math.floor(A*N/B)))
else:
print((math.floor(A*(B-1)/B-A*math.floor((B-1)/B)))) | p02696 |
a,b,n=list(map(int,input().split()))
ans=0
t=min(b,n)
for i in range(t,min(t-3,-1),-1):
ans=max(ans,((a*i)//b-(a*(i//b))))
print(ans)
| a,b,n=list(map(int,input().split()))
ans=0
t=min(b,n)
for i in range(t,max(t-3,-1),-1):
ans=max(ans,((a*i)//b-(a*(i//b))))
print(ans)
| p02696 |
# -*- coding: utf-8 -*-
a, b, n = list(map(int, input().split()))
ans_list = []
for i in range(int(b / 10), n + 1):
#print(int((a * i) / b), a * int(i / b), int((a * i) / b) - a * int(i / b))
ans = int((a * i) / b) - a * int(i / b)
ans_list.append(ans)
print((max(ans_list)))
| # -*- coding: utf-8 -*-
# x = p * b + q
# 0 <= q < b
# int(a * p + a * q / b) - a * int(p - q / b)
# = a * p + int(a * q / b) - a * p
# = int(a * q / b)
a, b, n = list(map(int, input().split()))
print((a * min(b - 1, n) // b))
| p02696 |
from math import floor
a,b,n = list(map(int, input().split()))
mx = 0
for i in range(n+1):
v = floor(a*i/b) - a*floor(i/b)
if v < mx:
break
else:
mx = v
print(mx)
| from math import floor
a,b,n = list(map(int, input().split()))
i = min(n,b-1)
print((floor(a*i/b) - a*floor(i/b))) | p02696 |
a,b,n=list(map(int,input().split()))
def f(x):
y=(a*x)//b-a*(x//b)
return y
print((f(min(b-1,n))))
| a,b,n=list(map(int,input().split()))
def f(x):
y=((a*x)//b)-a*(x//b)
return y
print((f(min(b-1,n))))
| p02696 |
A, B, N = list(map(int, input().split()))
if B > N:
ans = int(A*N/B)
print(ans)
else:
t = int(A*N/B)- A*int(N/B)
ans = 0
x = (N//B)*B - 1
while True:
temp = int(A*x/B) - A*int(x/B)
# if ans > temp:
# break
# ans = temp
ans = max(ans, tem... | A, B, N = list(map(int, input().split()))
if B > N:
print((int((A*N)/B)-A*int(N/B)))
else:
print((int((A*(B-1))/B)-A*int((B-1)/B)))
# if B > N:
# ans = floor(A*N/B)
# print(ans)
# else:
# ans = floor(A*N/B) - A*floor(N/B)
# ans_2nd = 0
# x = (N//B)*B - 1
# temp = floor((A... | p02696 |
import math
a, b, n = list(map(int, input().split()))
def f(x):
return math.floor(a * x / b) - a * math.floor(x // b)
print((f(min(b - 1, n)))) | import math
a, b, n = list(map(int, input().split()))
def f(x):
return (a * x) // b - a * (x // b)
left, right = 0, n
# 答えが整数になる場合このrightとleftの幅を3未満にするとバグる
while abs(right - left) > 3:
mid1 = (right * 2 + left) // 3 + 1
mid2 = (right + left * 2) // 3
if f(mid1) <= f(mid2):
# 上限を下げる... | p02696 |
import math
a, b, n = list(map(int, input().split()))
def f(x):
return (a * x) // b - a * (x // b)
left, right = 0, n
# 答えが整数になる場合このrightとleftの幅を3未満にするとバグる
while abs(right - left) > 3:
mid1 = (right * 2 + left) // 3 + 1
mid2 = (right + left * 2) // 3
if f(mid1) <= f(mid2):
# 上限を下げる... | import math
a, b, n = list(map(int, input().split()))
def f(x):
return (a * x) // b - a * (x // b)
left, right = 0, n
# 答えが整数になる場合このrightとleftの幅を3未満にするとバグる
while abs(right - left) > 3:
mid1 = (right * 2 + left) // 3 + 1
mid2 = (right + left * 2) // 3
if f(mid1) <= f(mid2):
# 上限を下げる... | p02696 |
from math import floor
A,B,N = list(map(int,input().split()))
Max = -100000000000000
for i in range(1,N+1):
Max = max(Max,floor(A*i/B)-A*floor(i/B))
print(Max) | A,B,N = list(map(int,input().split()))
x = min(N,B-1)
print((int(A*x/B))) | p02696 |
import math
a,b,n = list(map(int, input().split()))
ans = 0
lenge = min(b-1, n)
for x in range(lenge+1):
y = int((a*x)/b) - a * int(x/b)
ans = max(y, ans)
print(ans) | a,b,n=list(map(int,input().split()))
x=min(b-1,n)
print(((a*x)//b-a*(x//b))) | p02696 |
def f(a,b,x):
return int(a*x/b) - a*int(x/b)
a,b,n = list(map(int,input().split()))
print((max([f(a,b,x) for x in range(1,n+1)])))
|
def f(a,b,x):
return int(a*x/b) - a*int(x/b)
a,b,n = list(map(int,input().split()))
if n < b:
print((f(a,b,n)))
else:
print((f(a,b,b-1)))
| p02696 |
A, B, N = list(map(int, input().split()))
Smx = 0
if B<N:
N = B
for i in range(N+1):
S = int((A*(i % B) - ((A*i) % B))/B)
if Smx<S:
Smx = S
print(Smx) | A, B, N = list(map(int, input().split()))
Smx = 0
if B<N:
N = B
for i in range(N,0,-1):
if i<N-A:
break
S = int((A*(i % B) - ((A*i) % B))/B)
if Smx<S:
Smx = S
print(Smx) | p02696 |
import math
A, B, N = list(map(int, input().split()))
max_num = 0
for x in range(1, N+1):
t = math.floor(A * x / B) - A * math.floor(x / B)
if t > max_num:
max_num = t
print(max_num) | def main():
A, B, N = list(map(int, input().split()))
x = min(B-1, N)
ans = int((A*x)/B) - A*int(x/B)
print(ans)
if __name__ == '__main__':
main()
| p02696 |
A,B,N = [int(x) for x in input().split()]
def f(x):
return int(A*x/B) - A * int(x/B)
R = f(N)
for xb in range(N//B):
x = (xb+1) * B - 1
R = max(R,f(x))
print(R) | A,B,N = [int(x) for x in input().split()]
def f(x):
return int(A*x/B) - A * int(x/B)
print((f(min(B-1,N)))) | p02696 |
import sys
a, b, n = list(map(int, input().split()))
if n < b:
ans = a * n // b
print(ans)
sys.exit()
elif n == b:
ans = a * (b-1) // b
print(ans)
sys.exit()
# n == 1のときは0 問題なし
r = n // b
ans = 0
for i in range(1, r + 1):
t = i * b - 1
ans_t = a * t // b - (a * (i ... | import sys
a, b, n = list(map(int, input().split()))
if n < b:
ans = a * n // b
print(ans)
sys.exit()
elif n == b:
ans = a * (b-1) // b
print(ans)
sys.exit()
# n == 1のときは0 問題なし
r = n // b
ans = 0
# for i in range(1, r + 1):
# t = i * b - 1
# ans_t = a * t // b - (a... | p02696 |
A,B,N = list(map(int,input().split()))
S = 0
n = N // B
if B <= N:
for i in range(1,n+1):
l = i * B - 1
S = max(S,(A*l)//B - A * (l//B))
else:
S = (A*N)//B
print(S)
| A,B,N = list(map(int,input().split()))
S = 0
n = N // B
r = N % B
if B > N:
S = (A*N)//B
else:
if r == 0:
S = (A*(N-1))//B - A * ((N-1)//B)
elif r == B - 1:
S = (A*N)//B - A * (N//B)
else:
S = (A*(n*B-1))//B - A * ((n*B-1)//B)
print(S)
| p02696 |
A, B, N = list(map(int, input().split()))
if B < N:
Max = int(A*(B-1)/B)
for x in range(B,1+N):
fx = int(A*x/B) - A * int(x/B)
Max = max(Max,fx)
elif B == N:
Max = int(A*(B-1)/B)
else:
Max = int(A*N/B)
print(Max)
| A, B, N = list(map(int, input().split()))
if B < N:
Max = int(A*(B-1)/B)
X = int(N/B)
fx = int(A*(B*X-1)/B) - A * int((B*X-1)/B)
# Max = max(fx,Max)
# for x in range(1,X):
# fx = int(A*x/B) - A * int(x/B)
# Max = max(Max,fx)
elif B == N:
Max = int(A*(B-1)/B)
else:
... | p02696 |
import math
A, B, N = list(map(int, input().split(' ')))
ans = 0
for x in range(min(B, N + 1)):
res = math.floor((A * x) / B) - A * (math.floor(x / B))
ans = max(res, ans)
print((int(ans)))
| import math
A, B, N = list(map(int, input().split(' ')))
ans = 0
x = min(B, N + 1) - 1
ans = math.floor((A * x) / B) - A * (math.floor(x / B))
print((int(ans)))
| p02696 |
import math
A, B, N = list(map(int, input().split(' ')))
ans = 0
x = min(B, N + 1) - 1
ans = math.floor((A * x) / B) - A * (math.floor(x / B))
print((int(ans)))
| import math
A, B, N = list(map(int, input().split(' ')))
x = min(B, N + 1) - 1
print((math.floor((A * x) / B) - A * (math.floor(x / B))))
| p02696 |
#!/usr/bin/env python3
import sys
import math
def solve(A: int, B: int, N: int):
max_b = 0
k = min(N,B-1)
# print(k)
# for x in range(min(N+1,1000000)):
max_b = math.floor(A*k/B)
print(max_b)
return
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (ti... | A,B,N = list(map(int, input().split()))
C = N - N%B
ans = A*(C-1)//B - A*((C-1)//B)
if B > N:
ans = (A*N//B) - A*(N//B)
print(ans) | p02696 |
# coding:utf-8
def main():
import math
a, b, n = list(map(int, input().split()))
ans = 0
for x in range(n, 0, -1):
tmp = math.floor((a * x) / b) - a * (math.floor(x / b))
ans = max(tmp, ans)
print(ans)
if __name__ == "__main__":
main()
| # coding:utf-8
import math
a, b, n = list(map(int, input().split()))
x = min(b - 1, n)
ans = math.floor((a * x) / b) - a * (math.floor(x / b))
print(ans)
| p02696 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math as mt
def main():
A, B, N = list(map(int, input().split()))
maxn = 0
if N > B:
for x in range(B-1, N+1, B):
temp = mt.floor(A*x/B) - A*mt.floor(x/B)
if temp >= maxn:
maxn = temp
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math as mt
def main():
A, B, N = list(map(int, input().split()))
maxn = 0
if N >= B:
maxn = mt.floor(A*(B-1)/B) - A*mt.floor((B-1)/B)
else:
maxn = mt.floor(A*N/B) - A*mt.floor(N/B)
print(maxn)
if _... | p02696 |
A, B, N = list(map(int, input().split()))
answer = 0
if B / 2 > N:
num = reversed(list(range(1, N + 1)))
else:
num = list(range(1, N + 1))
for x in num:
value = int(A * x / B) - A * int(x / B)
if answer <= value:
answer = value
if x == B:
break
print(answer) | A, B, N = list(map(int, input().split()))
answer = 0
if N < B:
x = N
else:
x = B - 1
value = int(A * x / B) - A * int(x / B)
print(value) | p02696 |
a,b,n=list(map(int,input().split()))
x=0
for i in range(n+1):
if x<=((a*i)//b)-a*(i//b):
x=((a*i)//b)-a*(i//b)
print(x) | a,b,n=list(map(int,input().split()))
if n<b:
print(((a*n)//b))
else:
print((a*(b-1)//b)) | p02696 |
a, b, n = list(map(int, input().split()))
n = min(n, b-1)
print((int((a * n) / b) - a * int(n / b))) | a, b, n = list(map(int, input().split()))
syou = n // b
if syou >= 1:
n = b * 1 - 1
print((int((a * n) / b) - a * int(n / b))) | p02696 |
a,b,n = [int(i) for i in input().split()]
ans = [0 for _ in range(b)]
for i in range(b):
ans[i] = (a*i // b - a * (i // b))
ans = ans[:n+1] if n < b else ans
print((max(ans))) | a,b,n = [int(i) for i in input().split()]
x = min(n,b-1)
print((a*x // b))
| p02696 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.