Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
import math
from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N = II()
S = input()

ans = 0
for i in range(1, N-2):
    for j in range(1+i, N):
        if j <= i:
            continue
        for k in range(1+j, N+1):
            if k <= j:
                continue
            if not(j-i == k-j or S[i-1] == S[j-1] or S[i-1] == S[k-1] or S[k-1] == S[j-1]):
                ans+=1
print(ans)

### FIXED CODE ###

import sys
import math
from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N = int(input())
S = input()
ans = S.count("R") * S.count("G") * S.count("B")
for i in range(N-2):
  for j in range(i+1,N-1):
    k=2*j-i
    if k>=N:
      continue
    if S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
      ans-=1
print(ans)
### BUGGY CODE ###

x = map(float,raw_input().split(' '))
import turtle
kame = turtle.Turtle()
kame.goto(x[2],x[3])
print kame.distance(x[0],x[1])

### FIXED CODE ###

x = map(float,raw_input().split(' '))
import turtle
kame = turtle.Turtle()
kame.speed(0)
kame.goto(x[2],x[3])
print kame.distance(x[0],x[1])
### BUGGY CODE ###

import heapq

def myprim_heap(graph, n):
    #始点sから各頂点への最短距離
    INF = 10**9
    d = [INF] * n
    used = [False] * n #True:未確定
    s = 0
    d[s] = 0
    used[s] = True
    res = 0
    edgelist = []
    for e in graph[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if used[minedge[1]]:
            continue
        res += minedge[0]
        v = minedge[1]
        used[v] = True
        for e in graph[v]:
            if not used[e[1]]:
                heapq.heappush(edgelist, e)
    return res


n = int(input()) 
graph = [[] for _ in range(n)]
ixy = [[i] + [int(x) for x in input().split()] for i in range(n)]

ixy = sorted(ixy, key=lambda x:(x[1], x[2]))
for i in range(n-1):
    j, k = ixy[i][0], ixy[i+1][0]
    d = ixy[i+1][1] - ixy[i][1]
    graph[j].append([d,k])
    graph[k].append([d,j])

ixy = sorted(ixy, key=lambda x:(x[2], x[1]))
for i in range(n-1):
    j, k = ixy[i][0], ixy[i+1][0]
    d = ixy[i+1][2] - ixy[i][2]
    graph[j].append([d,k])
    graph[k].append([d,j])

res = myprim_heap(graph, n)
print(res)

### FIXED CODE ###

from operator import itemgetter
from scipy.sparse import csr_matrix
import numpy as np

N = int(input())

XY = [[i] + [int(x) for x in input().split()] for i in range(N)]

edge = set()
for key in [itemgetter(1),itemgetter(2)]:
  XY.sort(key = key)
  for i in range(N-1):
    i1,x1,y1 = XY[i]
    i2,x2,y2 = XY[i+1]
    d = min(abs(x1-x2),abs(y1-y2))
    edge.add((i1,i2,d))
    
# csr形式に直す
row,col,value = zip(*edge)
value = np.array(value,dtype=int)
graph = csr_matrix((value,(row,col)),shape=(N,N))

# 最小全域木
from scipy.sparse.csgraph import minimum_spanning_tree
tree = minimum_spanning_tree(graph, overwrite = True).astype(int)
answer = tree.sum()
print(answer)
### BUGGY CODE ###

from itertools import combinations

n = int(input())
a = list(map(int, input().split()))
ans = 0

for i, j in combinations(range(n), 2):
    if a[i] + a[j] == abs(i-j):
        ans += 1

print(ans)



### FIXED CODE ###

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

ans = 0
mp = {}

for i in range(n):
    sa = i - a[i]
    if sa in mp:
        ans += mp[sa]
    wa = i + a[i]
    if wa in mp:
        mp[wa] += 1
    else:
        mp[wa] = 1

print(ans)
### BUGGY CODE ###

X,Y,Z,K = (int(x) for x in input().split())
A = sorted([int(x) for x in input().split()])[::-1]
B = sorted([int(x) for x in input().split()])[::-1]
C = sorted([int(x) for x in input().split()])[::-1]

AB = []
for i in range(X):
    for j in range(Y):
        AB.append(A[i]+B[j])
AB = sorted(AB)[::-1]

ans = []
for i in range(min(K,len(AB))):
    for j in range(min(K,Z)):
        ans.append(AB[i]+C[j])
ans.sort()

for i in range(K):
    print(ans[-i-1])


### FIXED CODE ###

X,Y,Z,K = (int(x) for x in input().split())
A = sorted([int(x) for x in input().split()])[::-1]
B = sorted([int(x) for x in input().split()])[::-1]
C = sorted([int(x) for x in input().split()])[::-1]

AB = []
for i in range(X):
    for j in range(Y):
        if i*j > K:
            break
        AB.append(A[i]+B[j])
AB = sorted(AB)[::-1]

ans = []
for i in range(min(K,len(AB))):
    for j in range(min(K,Z)):
        if i*j > K:
            break
        ans.append(AB[i]+C[j])
ans.sort()

for i in range(K):
    print(ans[-i-1])
### BUGGY CODE ###

N = int(input())
S = input()
ca = ord('a')
T = [ord(c) - ca for c in S]

ans = 0
nds = [[None]*26 for i in range(N**2)]
root = nds[0]
cs = [root]*N
gen = 0
for i in range(N):
    j = i
    cur = root
    while j < N and cur[T[j]] is not None:
        cur = cur[T[j]]
        j += 1
    ans = max(ans, j - i)
    e = T[i]
    for k in range(i):
        c = cs[k]
        if c[e] is None:
            cs[k] = c[e] = nds[gen]
            gen += 1
        else:
            cs[k] = c[e]
print(ans)


### FIXED CODE ###

def solve():
    N = int(input())
    S = input()

    base = 37
    def rolling_hash(s, mod):
        l = len(s)
        h = [0]*(l + 1)
        v = 0
        for i in range(l):
            h[i+1] = v = (v * base + ord(s[i])) % mod
        pw = [1]*(l + 1)
        v = 1
        for i in range(l):
            pw[i+1] = v = v * base % mod
        return h, pw

    mod1 = 10**9 + 9; mod2 = 10**9 + 7
    h1, pw1 = rolling_hash(S, mod1)
    h2, pw2 = rolling_hash(S, mod2)

    def chk(l, h, pw, mod):
        p = pw[l]
        for i in range(min(l, N-2*l+1)):
            D[i] = (h[l+i] - h[i]*p) % mod
        s = set()
        for i in range(l, N-l+1):
            s.add(D[i-l])
            D[i] = v = (h[l+i] - h[i]*p) % mod
            if v in s:
                return 1
        return 0

    H = [set() for i in range(N//2+2)]
    D = [0]*N
    E = [0]*N
    k = N//2
    for l in range(1, N//2+1):
        if not chk(l, h1, pw1, mod1):
            k = l-1
            break
    ans = 0
    for l in range(k, 0, -1):
        if chk(l, h2, pw2, mod2):
            ans = l
            break
    print(ans)
solve()
### BUGGY CODE ###

n, c, k = map(int, input().split())
t = sorted([int(input()) for _ in range(n)])

bus = []
ans = 0

while len(t) != 0:
	temp = t.pop(0)
	if len(bus) == 0:
		bus.append(temp)
	else:
		if temp < bus[0] + k:
			bus.append(temp)
			if len(bus) == c:
				ans += 1
				bus = []
		else:
			ans += 1
			bus = []

print(ans+1)

### FIXED CODE ###

n, c, k = map(int,input().split())
t = sorted([int(input()) for _ in range(n)])

ans = 0
bus = []

for i in range(n):
	if len(bus) == c:
		ans += 1
		bus = [t[i]]
	elif bus != [] and bus[0] + k < t[i]:
		ans += 1
		bus = [t[i]]
	else:
		bus.append(t[i])

print(ans+1)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
for _ in range(2,n+1):
  if a[_-1] in a[:_-1]:
    print('NO')
    exit()
print('YES')

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
if len(a)==len(set(a)):
  print('YES')
else:
  print('NO')
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 9)

n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(m):
    x, y = map(int, input().split())
    edges[y - 1].append(x - 1)
used = [False for _ in range(n)]
dp = [0 for _ in range(n)]

def dfs(pos):
    if not edges[pos]:
        dp[pos] = 0
        return
    for n_pos in edges[pos]:
        if not used[n_pos]:
            dfs(n_pos)
        dp[pos] = max(dp[pos], dp[n_pos] + 1)
        

for i in range(n):
    if used[i]:
        continue
    used[i] = True
    dfs(i)
    
print(max(dp))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.buffer.readline

def main():
    n, m = map(int, input().split())
    edges = [[] for _ in range(n)]
    for _ in range(m):
        x, y = map(int, input().split())
        edges[y - 1].append(x - 1)
    used = [False for _ in range(n)]
    dp = [0 for _ in range(n)]
    
    def dfs(pos):
        if not edges[pos]:
            dp[pos] = 0
            return
        for n_pos in edges[pos]:
            if not used[n_pos]:
                dfs(n_pos)
            used[n_pos] = True
            dp[pos] = max(dp[pos], dp[n_pos] + 1)
            
    
    for i in range(n):
        if used[i]:
            continue
        used[i] = True
        dfs(i)
        
    print(max(dp))

main()
### BUGGY CODE ###

n,m = map(int,input().split())
lst = sorted(list(map(int,input().split())))
for i in range(m):
    lst[-1] //= 2
    lst.sort()
    if sum(lst) == 0:
        break
print(sum(lst))

### FIXED CODE ###

import heapq
import math
n,m = map(int,input().split())
lst = [int(x) * (-1) for x in input().split()]
heapq.heapify(lst)
for use_cnt in range(m):
    num = heapq.heappop(lst) * -1
    nxt_num = math.floor(num / 2)
    heapq.heappush(lst,nxt_num * -1)
print(sum(lst) * (-1))
### BUGGY CODE ###

a,b=map(int,input().split())
yaku=[]
flag=0
for i in range(2,min(a,b)+1):
    if a%i==0 and b%i==0:
        yaku.append(i)
ans=len(yaku)
flag=0
for i in range(1,len(yaku)+1):
    flag=0
    for j in range(i+1,len(yaku)+1):
        if yaku[-i]%yaku[-j]==0:
            flag=1
            #print(i)
            break
    if flag==1:
        ans-=1
        #print("ans=",ans)
print(ans+1)


### FIXED CODE ###

import math
#最大公約数
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
#因数分解
def factorize(x):
    f=[]
    div=2
    while div**2<=x:
        while x%div==0:
            f.append(div)
            x=x//div
        div+=1
    if x>1:
        f.append(x)
    return f

"""def factorize(x):
    ans=1#約数１
    div=2
    while div**2<=x:
        while x%div==0:
            x=x//div
            flag=1
        if flag==1:
            ans+=1
        div+=1
        flag=0
    if x>1:
        ans+=1
    return ans"""

a,b=map(int,input().split())
g=gcd(a,b)
f=factorize(g)
print(len(set(f))+1)
### BUGGY CODE ###

import numpy as np


def atcoder_input():
    H, W = (int(i) for i in input().split())
    tmp = []

    for i in range(H):
        l = [j for j in input().split()]
        tmp.append(list(l[0]))
    tmp = np.array(tmp)

    A=(tmp=="#").astype(int)

    return A, H, W


def main():
    A, H, W = atcoder_input()

    old_x_where = list(np.where(A == 1)[0])
    old_y_where = list(np.where(A == 1)[1])

    counter = 0

    while np.min(A) == 0:
        counter += 1
        new_x_where = []
        new_y_where = []

        for i in range(4):
            if i == 0:
                tmp_x = list(np.clip(np.array(old_x_where) + 1, 0, W - 1))
                tmp_y = list(np.clip(np.array(old_y_where), 0, H - 1))
            elif i == 1:
                tmp_x = list(np.clip(np.array(old_x_where), 0, W - 1))
                tmp_y = list(np.clip(np.array(old_y_where) + 1, 0, H - 1))
            elif i == 2:
                tmp_x = list(np.clip(np.array(old_x_where) - 1, 0, W - 1))
                tmp_y = list(np.clip(np.array(old_y_where), 0, H - 1))
            else:  # i=3
                tmp_x = list(np.clip(np.array(old_x_where), 0, W - 1))
                tmp_y = list(np.clip(np.array(old_y_where) - 1, 0, H - 1))

            new_x_where.extend(tmp_x)
            new_y_where.extend(tmp_y)

        A[new_y_where, new_x_where] = 1
        old_x_where = new_x_where
        old_y_where = new_y_where

    print(counter)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())

# input black cells
black_cells = []

for h in range(H):
    line = list(input())
    for w in range(W):
        if line[w] == "#":
            black_cells.append(h * W + w)


# Graph
def r(p):
    q_list = []
    h = p // W
    w = p % W
    if h != 0:
        q_list.append(p - W)
    if h != H-1:
        q_list.append(p + W)
    if w != 0:
        q_list.append(p - 1)
    if w != W-1:
        q_list.append(p + 1)
    return q_list


queue = deque(black_cells)
d = [10000] * (H * W)
for i in black_cells:
    d[i] = 0

# dijkstra
while len(queue) > 0:
    p = queue.popleft()
    for q in r(p):
        if d[q] > d[p] + 1:
            d[q] = d[p] + 1
            queue.append(q)

print(max(d))
### BUGGY CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

for i in range(N):
    temp = A.pop(i)
    print(max(A))
    A.insert(i, temp)



### FIXED CODE ###

import copy

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

chinpo = max(A)
B = copy.copy(A)
B.remove(max(A))
chinchin = max(B)

for i in range(A.index(max(A))):
    print(chinpo)
print(chinchin)
for i in range(A.index(max(A))+1,N):
    print(chinpo)
### BUGGY CODE ###

import sys
#import copy
#import numpy as np
#import itertools
#import collections
#from collections import deque
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
#read = sys.stdin.buffer.read

def main():
    # input
    N = int(readline())
    S = input()

    ans = 0
    for i in range(N-2):
        menu = ['R', 'G', 'B']
        si = S[i]
        menu.remove(si)
        for j in range(i+1, N-1):
            if S[j] == si:
                continue
            tmpmenu = menu.copy()
            sj = S[j]
            tmpmenu.remove(sj)
            sk = tmpmenu[0]
            jk_list = [k + 1 for k, v in enumerate(S[j+1:]) if v == sk]
            ans += len([n for n in jk_list if n != j-i])

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
#import copy
#import numpy as np
#import itertools
import collections
#from collections import deque
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read
count = collections.Counter

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

    values = list(count(S).values())
    if len(values) < 3:
        print(0)
        return
    
    ans = values[0] * values[1] * values[2]

    for i in range(N-2):
        for j in range(i+1, N-1):
            k = 2 * j - i
            if k >= N:
                break
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                ans -= 1

    print(ans)
    #print('end')


if __name__ == "__main__":
    main()
### BUGGY CODE ###

import itertools 

N = int(input())
A = list(map(int, input().split(' ')))

for k in range(N):
    A_replace = A[:]
   
    del A_replace[k]
    cnt = 0 
    for i in set(A_replace):
        cnt += ((A_replace.count(i) * (A_replace.count(i)-1)) / 2)
    A_replace = A
    print(int(cnt))

### FIXED CODE ###

import collections

N = int(input())
A = list(map(int, input().split(' ')))

A_counter= collections.Counter(A)

_sum = 0
for count in A_counter:
    _sum += (A_counter[count]* (A_counter[count]-1)) // 2

for k in range(N):
    l = (A_counter[A[k]]) *  (A_counter[A[k]]-1)//2
    m = (A_counter[A[k]]-1) *  (A_counter[A[k]]-2)//2
    # print(_sum)
    # print(c_a)
    print(_sum -l + m)
### BUGGY CODE ###

from collections import deque
n = int(input())
q = deque(map(int, input().split()))
ans = []
for i in q:
  ans.append(i)
  ans = ans[::-1]

print(*ans)

### FIXED CODE ###

from collections import deque
n = int(input())
l = map(int, input().split())
ans = deque()
for idx, v in enumerate(l):
  if idx % 2 == 0:
    ans.append(v)
  else:
    ans.appendleft(v)
if len(ans) % 2 == 1:
  ans.reverse()
            
print(*ans)
### BUGGY CODE ###

N=int(input())
import math
sqN=math.sqrt(N)
sqN=math.floor(sqN)
i=sqN

while N%i!=0:
    i-=1
a=math.floor(math.log10(i))+1
b=math.floor(math.log10(N//i))+1
candA=max(a,b)
i=sqN
while N%i!=0:
    i+=1
a=math.floor(math.log10(i))+1
b=math.floor(math.log10(N//i))+1
candB=max(a,b)

print(min(candA,candB))

### FIXED CODE ###

N=int(input())
import math
sqN=math.sqrt(N)
sqN=math.ceil(sqN)
i=1
ans=float('inf')
def digits(n):
    return(math.floor(math.log10(n))+1)
while i <= sqN:
    q,r=divmod(N,i)
    if r==0:
        ans=min(ans,max(digits(i),digits(q)))
    i+=1
print(ans)
### BUGGY CODE ###

import queue
n,m=map(int,input().split())
a=[[] for j in range(n)]
for i in range(0,m):
    b,c=map(int,input().split())
    a[b-1].append(c-1)
    a[c-1].append(b-1)
re=[0 for i in range(n)]
le=[0]
for i in range(0,n):
    if re[i]==0:
        ans=queue.Queue()
        ans.put(i)
        le.append(1)
        re[i]=1
        while ans.empty()==False:
            d=ans.get()
            for j in range(len(a[d])):
                if re[a[d][j]]==0:
                    ans.put(a[d][j])
                    re[a[d][j]]=1
                    le[-1]+=1
print(max(le))

### FIXED CODE ###

import queue
n,m=map(int,input().split())
a=[[] for j in range(n)]
for i in range(0,m):
    b,c=map(int,input().split())
    a[b-1].append(c-1)
    a[c-1].append(b-1)
re=[0 for i in range(n)]
le=[0]
for i in range(0,n):
    if re[i]==0:
        ans=queue.Queue()
        ans.put(i)
        le.append(1)
        re[i]=1
        while ans.empty()==False:
            d=ans.get()
            for j in range(len(a[d])):
                if re[a[d][j]]==0:
                    ans.put(a[d][j])
                    re[a[d][j]]=1
                    le[-1]+=1
print(max(le))
### BUGGY CODE ###

#入力
N = int(input())
Alist = list(map(int,input().split()))
Q = int(input())
Blist = []
Clist = []
for i in range(Q):
  B, C = map(int,input().split())
  Blist.append(B)
  Clist.append(C)

for j in range(Q):
  for k in range(len(Alist)):
    if Alist[k] == Blist[j]:
      Alist[k] = Clist[j]
  print(sum(Alist))

### FIXED CODE ###

import collections
#入力
N = int(input())
n = 100001
Alist = list(map(int,input().split()))
Q = int(input())
Blist = []
Clist = []
for i in range(Q):
  B, C = map(int,input().split())
  Blist.append(B)
  Clist.append(C)

Adic = dict(collections.Counter(Alist))
numlist = [0]*n

for j in range(n):
  if j in Adic:
    numlist[j] = Adic[j]
sum = sum(Alist)
for k in range(Q):
  sum += (Clist[k]-Blist[k])*numlist[Blist[k]]
  numlist[Clist[k]] += numlist[Blist[k]] 
  numlist[Blist[k]] = 0

  print(sum)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(3 * 10 ** 5)

def bfs(root, parent):
    global AL, cnt
    for v in AL[root]:
        if v != parent:
            cnt[v] += cnt[root]
            bfs(v, root)

N, Q = [int(x) for x in input().split()]
AL = [[] for _ in range(N + 1)]
for i in range(1, N):
    a, b = [int(x) for x in input().split()]
    AL[a].append(b)
    AL[b].append(a)

cnt = [0] * (N + 1)
for j in range(Q):
    p, x = [int(x) for x in input().split()]
    cnt[p] += x

bfs(1, -1)
s = " ".join(map(str, cnt[1:]))
print(s)

### FIXED CODE ###

# 20/5/28
from collections import deque

N, Q = [int(x) for x in input().split()]
AL = [[] for _ in range(N + 1)]
for i in range(1, N):
    a, b = [int(x) for x in input().split()]
    AL[a].append(b)
    AL[b].append(a)

cnt = [0] * (N + 1)
for j in range(Q):
    p, x = [int(x) for x in input().split()]
    cnt[p] += x

visited = [False] * (N + 1)
stk = deque([1])
while stk:
    root = stk.pop()
    visited[root] = True
    for v in AL[root]:
        if not visited[v]:
            cnt[v] += cnt[root]
            stk.append(v)

s = " ".join(map(str, cnt[1:]))
print(s)
### BUGGY CODE ###

A, B, N = map(int, input().split())
max = 0
for x in range(N+1):
  f = int(A*x/B) - (A * int(x/B))
  if f > max:
    max = f
print(max)

### FIXED CODE ###

def f(a, b, x):
  return int(a*x/b) - (a*int(x/b))
A, B, N = map(int, input().split())
print(f(A, B, min(B-1, N)))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
abc = [list(map(int, input().split())) for _ in range(n)]


def recur(i, last_index, v):
    if i == n:
        return v
    res = -1
    for j in range(3):
        if j == last_index:
            continue
        res = max(res, recur(i + 1, j, v + abc[i][j]))
    return res


print(recur(0, -1, 0))


### FIXED CODE ###

n = int(input())
days = [list(map(int, input().split())) for _ in range(n)]
dp = [[0, 0, 0] for _ in range(n)]

for i in range(n):
    if 0 == i:
        dp[i][0] = days[0][0]
        dp[i][1] = days[0][1]
        dp[i][2] = days[0][2]
    else:
        dp[i][0] = max(days[i][0] + dp[i-1][1], days[i][0] + dp[i-1][2])
        dp[i][1] = max(days[i][1] + dp[i-1][2], days[i][1] + dp[i-1][0],)
        dp[i][2] = max(days[i][2] + dp[i-1][0], days[i][2] + dp[i-1][1],)

print(max(dp[-1]))
### BUGGY CODE ###

N = int(input())
H = list(map(int,input().split()))

ans = 0
for i in range(N-1):
    count = 0
    for j in range(i,N-1):
        if H[j] >= H[j+1]:
            count += 1
            if count > ans:
                ans = count
        else:
            break


print(ans)

### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))

h = [0 for i in range(N-1)]
ans = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        h[i] = 1

count = 0
ans = 0
for i in h:
    if i == 1:
        count += 1
        if ans < count:
            ans = count
    else:
        count = 0

print(ans)
### BUGGY CODE ###

h=int(input())
count=1
ans=1
v=h
while True:
    temp=int(v//2)
    #count=count*2
    #ans+=count
    if temp==1:
        count=count*2
        ans+=count
        break
    v=temp
    count=count*2
    ans+=count
    
print(ans)




### FIXED CODE ###

h=int(input())
count=1
ans=1
v=h
import math
while True:
    temp=math.floor(v/2)
    if temp==0:
        #count=count*2
        #ans+=1
        #ans+=count
        break
    v=temp
    ans+=1
    
print(int((1-2**(ans))/(1-2)))