Harryxun/stf_run huggingface dataset:
import math
N = int(input())
t= 1
a= 1

def t_small(t,a,t1,a1):
    gain = -(-t//t1)
    t = gain*t1
    a_tmp=gain*a1
    if a_tmp<a:
        gain_a = -(-a//a_tmp)
        t *= gain_a
        a = a_tmp*gain_a
    else:
        a = a_tmp
    return t,a,t+a

def a_small(t,a,t1,a1):
    gain = -(-a//a1)
    a = gain*a1
    t_tmp=gain*t1
    if t_tmp<t:
        gain_t = -(-t//t_tmp)
        a *= gain_t
        t = t_tmp*gain_t
    else:
        t = t_tmp
    return t,a,t+a

ans = 0
for _ in range(N):
    t1,a1 = map(int,input().split())
    tt1,aa1,sta1 = t_small(t,a,t1,a1)
    tt2,aa2,sta2 = a_small(t,a,t1,a1)
    if sta1<=sta2:
        t=tt1;a=aa1,ans = sta1
    else:
        t=tt2,a=aa2,ans=sta2
print(ans)

### FIXED CODE ###

import math
N = int(input())
t= 1
a= 1

def t_small(t,a,t1,a1):
    gain = -(-t//t1)
    t = gain*t1
    a_tmp=gain*a1
    if a_tmp<a:
        gain_a = -(-a//a_tmp)
        t *= gain_a
        a = a_tmp*gain_a
    else:
        a = a_tmp
    return t,a,t+a

def a_small(t,a,t1,a1):
    gain = -(-a//a1)
    a = gain*a1
    t_tmp=gain*t1
    if t_tmp<t:
        gain_t = -(-t//t_tmp)
        a *= gain_t
        t = t_tmp*gain_t
    else:
        t = t_tmp
    return t,a,t+a

ans = 0
for _ in range(N):
    t1,a1 = map(int,input().split())
    tt1,aa1,sta1 = t_small(t,a,t1,a1)
    tt2,aa2,sta2 = a_small(t,a,t1,a1)
    if sta1<=sta2:
        t=tt1;a=aa1;ans = sta1
    else:
        t=tt2;a=aa2;ans=sta2
print(ans)
# 8 = 2 * 2 * 2
# 6 = 2 * 3
x = int(input())
y = int(input())
result = 0

if x % y == 0:
    result = -1
else:
    result = x * 2


print(result)


### FIXED CODE ###

# 8 = 2 * 2 * 2
# 6 = 2 * 3
x,y= map(int,(input().split()))

result = 0

if x % y == 0:
    result = -1
else:
    result = x 


print(result)
import math
n=int(input())
ar=list(map(int,input().split()))

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/math.gcd(an,ar[x]);
print(an)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import collections
import math
import fractions 

# code start
raw_input = input


def lcm(a,b):
	return a*b/fractions.gcd(int(a),int(b))

def main():
	count = int(input())
	i = 0
	temp = 1
	while(i<count):
		i+=1
		num = int(input())
		temp = lcm(temp,num)
	print(int(temp))


if __name__ == '__main__':
    main()

# code end
#include <bits/stdc++.h>
using namespace std;


void solve(std::string S){

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def count_L_slow(S, N):
    ret=0
    for i in range(N):
        if S[i:i+1]=='>':
            ret+=1
        else:
            break
    return ret

def solve(S: str):
########################### added
    next_S = [-1 for i in range(len(S) + 1)]
    next_L = [-1 for i in range(len(S) + 1)]

    next_S[len(S)] = -1

    for i in range(len(S) - 1, -1, -1):
        if S[i] == '>':
            next_S[i] = i
        else:
            next_S[i] = next_S[i + 1]

    next_L[len(S)] = -1

    for i in range(len(S) - 1, -1, -1):
        if S[i] == '<':
            next_L[i] = i
        else:
            next_L[i] = next_L[i + 1]

###########################

    #count '<'
    def count_S(i, N):
#        ret=S.find('>')
        if i >= len(next_S):
            return N
        ret = next_S[i] - i
        if ret < 0:
            ret = N
        return ret
    
    #count '>'
    def count_L(i, N):
#        ret=S.find('<')
        if i >= len(next_L):
            return N
        ret = next_L[i] - i
        if ret < 0:
            ret = N
        return ret


#    #count '<'
#    def count_S(S, N):
#        ret=S.find('>')
#        #print("<",S,N,ret)
#        if ret==-1:
#            ret=N
#        return ret
#    
#    #count '>'
#    def count_L(S, N):
#        ret=S.find('<')
#        if ret==-1:
#            ret=N
#        #print(">",S,N,ret)
#        return ret

    answer=0

    cnt_l=count_L(0,len(S))
    answer+=int((cnt_l+1)*cnt_l/2)
    i=cnt_l


    while i<len(S):
#        cnt_s=count_S(S[i:],len(S[i:]))
#        cnt_l=count_L(S[i+cnt_s:],len(S[i+cnt_s:]))

        cnt_s=count_S(i, len(S) - i)
        cnt_l=count_L(i+cnt_s, len(S) - (i+cnt_s))

        answer+=int((cnt_s+1)*cnt_s/2)
        answer+=int((cnt_l+1)*cnt_l/2)
        if cnt_l>cnt_s:
           answer-=cnt_s
        else:
           answer-=cnt_l
        #answer+=(cnt_l+1)*cnt_l//2
        #print("cnt_s,cnt_l",cnt_s, cnt_l,answer)
        i+=cnt_s+cnt_l

    print(answer)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()
color = []
color.append(int(input(),range(3)))
x = count(color[0])
y = count(color[1])
if x == 1 and y == 1:
  print("3")
else if x == 1 and y == 2:
  print("2")
else if x == 2:
  print("2")
else:
  print("1")

### FIXED CODE ###

n = list(map(int, input().split()))
N = list(set(n))
print(len(N))
A, B, K = map(int, input().split())


def gcd(a, b):
    x = max(a, b)
    y = min(a, b)
    mod = x % y
    if mod == 0:
        return y

    return gcd(y, mod)


mx = gcd(A, B)
count = 0
for a in range(mx, 1, -1):
    print(a)
    if A % a == 0 and B % a == 0:
        count += 1
    if count == K:
        ans = a
        break
print(ans)


### FIXED CODE ###

A, B, K = map(int, input().split())


def gcd(a, b):
    x = max(a, b)
    y = min(a, b)
    mod = x % y
    if mod == 0:
        return y

    return gcd(y, mod)


mx = gcd(A, B)
count = 0

for a in range(mx, 0, -1):
    if A % a == 0 and B % a == 0:
        count += 1
    if count == K:
        ans = a
        break

print(ans)
import math
n=int(input())
print(math.ceil(n/2)

### FIXED CODE ###

import math
n=int(input())
print(math.ceil(n/2))
S = list(input())
K = int(input())

#print(link_S)
#S = S.append(S[len(S)-1])
i = 0
sum = 1
total_sum = 0
sum_ketu = 0
while(1):
    if i == len(S)-1:
        if S[i] == S[0] and S[0] != S[1]:
            if sum % 2 == 1:
                sum += 1
                sum_ketu = -1
        break
    if S[i] == S[i+1]:
     #   print("i is", i)
     #   print("S[i] is", S[i], "S[i+1] is", S[i+1])
        sum += 1
     #   print(sum)
        i += 1
    else:
        total_sum += sum // 2
        sum = 1
        i += 1
        
total_sum += sum // 2
#print(sum_ketu)
#print(total_sum)
print(total_sum * K + sum_ketu)



### FIXED CODE ###

S = list(input())
K = int(input())

if len(S) == 1:
    print( K // 2)
    exit()

count = 1
i = 0
sum = 0
while(1):
    if S[i] == S[i+1]:
        count += 1
        i += 1
    else:
        sum += count//2
        count = 1
        i += 1
    if i == len(S)-1:
        break

sum += count//2 #最後のカウントの加算

#print("check1",sum)

#先頭の連続数をカウント
j = 0 # リストカウント
a = 1 # 連続数カウント
while(1):
    if S[j] == S[j+1]:
        a += 1
        j += 1
    else:
        break
    if j == len(S) -1:
        break
#print("check")

#末尾の連続数をカウント
m = len(S)-1 # リストカウント
b = 1 # 連続数カウント
while(1):
    if S[m] == S[m-1]:
        m -= 1
        b += 1
    else:
        break
    if m == 0:
        break

#print("a is",a)
#print("b is",b)
#print("sum is", sum)
if a == len(S): #１文字のみで文字列構成の場合
    print((len(S)* K)//2)
elif S[len(S)-1] == S[0]:
    print( sum * K + ((a+b)//2 - a//2 - b //2 ) * ( K -1))
else:
    print( sum * K)
n = int( input() )

for i in range( 0, n ):
	m =  input() 
	print(m)
nm=0
nm1=0
cnt=m
for i in cnt:
      if i=='A' or i=='B':
              nm+=1
              nm1=max(nm1,nm)
      else:
              nm=0
print(nm1)

### FIXED CODE ###

n,k=map(int,input().split())

for i in range(k):
      nm=[i,1+i ]
for j in range (n):
      nm1=[i,1+i]
print(n-k+1)
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
t = input()
n = len(s)
m = len(t)

i = 0
while i < n-m:
    if (s[i] == t[0]) or (s[i] == '?'):
        j = i
        flg = True
        while j-i < m:
            if (s[j] == t[j-i]) or (s[j] == '?'):
                j += 1
            else:
                flg = False
                break
        if flg:
            j -= 1
            break
    i += 1
if not flg:
    print('UNRESTORABLE')
    quit()
ans = ''
cnt = 0
for k in range(n):
    if k < i:
        if s[k] == '?':
            ans += 'a'
        else:
            ans += s[k]
    elif i <= k <= j:
        ans += t[cnt]
        cnt += 1
    else:
        if s[k] == '?':
            ans += 'a'
        else:
            ans += s[k]
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
#ABC76 C

from copy import deepcopy
s = list(input())
t = list(input())

ns = len(s)
nt = len(t)
f1 = 0
for i in range(ns):
    if s[i] in t:
        ind = t.index(s[i])
        for j in range(i-ind,i-ind+nt):
            if j < ns:
                if s[j] == t[j-i+ind] or s[j] == '?':
                    continue
                else:
                    break
            else:
                break
        else:
            f1 = 1
            x = deepcopy(s)
            x[i-ind:i-ind+nt] = t
            break
f2 = 0
for i in range(ns)[::-1]:
    if s[i] == '?':
        for j in range(i,i+nt):
            if j < ns:
                if s[j] == t[j-i] or s[j] == '?':
                    continue
                else:
                    break
            else:
                break
        else:
            f2 = 1
            y = deepcopy(s)
            y[i:i+nt] = t
            break
if f1 & f2:
    for i in range(ns):
        if x[i] == '?':
            x[i] = 'a'
        if y[i] == '?':
            y[i] = 'a'
    x = ''.join(x)
    y = ''.join(y)
    ans = [x,y]
    ans.sort()
    print(ans[0])

elif f1 and not f2:
    for i in range(ns):
        if x[i] == '?':
            x[i] = 'a'
    x = ''.join(x)
    print(x)
elif not f1 and f2:
    for i in range(ns):
        if y[i] == '?':
            y[i] = 'a'
    y = ''.join(y)
    print(y)
else:
    print('UNRESTORABLE')
A=int(input())
B=int(input())

if(A>B):
    print(2*A-1)
elif(A==B):
    print(A*2)
elif(B>A):
    print(B*2-1)


### FIXED CODE ###

a,b=map(int,input().split())
#a,b=(input().split())
c=max(a,b)
d=min(a,b)
if  c>d:
    print(2*c-1)

else:
    print(c+d)
N = int(input())
ls = list(map(int, input().split(' ')))
d = {}
for l in ls:
    if l in d:
        d[l] += 1
    else:
        d[l] = 1

m = 0
for k in range(1, 100002):
    if k in d:
        c += d[k]
    if (k-1) in d:
        c += d[k-1]
    if (k+1) in d:
        c += d[k+1]
    m = max(m,c)
print(m)


### FIXED CODE ###

X, t = list(map(int, input().split(' ')))
print(X - t if (X - t) >= 0 else 0)
N, K = list(map(int, input().split()))
h = list(map(int, input().split()))

INF = 10**18
dp = [INF] * 10**5
h = h + [0]*(10**5 - len(h))

dp[0] = 0

for i in range(N):
    for j in range(1, K+1):
        dp[i+j] = min(dp[i+j], dp[i] + abs(h[i] - h[i+j]))

print(dp[N-1])


### FIXED CODE ###

from sys import stdin
N, K = [int(x) for x in stdin.readline().rstrip().split()]
h = [int(x) for x in stdin.readline().rstrip().split()]

INF = 10**18
dp = [INF] * (N + K)

dp[0] = 0

for i in range(N):
    for j in range(1, K+1):
        if i + j < N:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i] - h[i+j]))
        else:
            break
print(dp[N-1])
x, a = map(int, input())
print(10 if x - a >= 0 else 0)

### FIXED CODE ###

x, a = map(int, input().split())
print(10 if x - a >= 0 else 0)
import sys

def main():
    input = sys.stdin.readline
    N, M = map(int, input().split())

    if N >= M // 2:
        ans = M // 2
        S -= M // 2

        ans += S // 2

        return ans

    else:
        ans = N
        M -= 2 * N

        ans += M // 4

        return ans


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


### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline
    N, M = map(int, input().split())

    if N >= M // 2:
        ans = M // 2
        #N -= M // 2

        #ans += N // 2

        return ans

    else:
        ans = N
        M -= 2 * N

        ans += M // 4

        return ans


if __name__ == '__main__':
    print(main())
for i in range(1,10):
    for j in range(1,10):
        print str(i)+"??"+str(j)+"="+str(i*j)

### FIXED CODE ###

for i in range(1,10):
    for j in range(1,10):
        print str(i)+"x"+str(j)+"="+str(i*j)
n=list(int(input()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)

### FIXED CODE ###

n=list(map(int,input().split()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)
a = []
n = int(input())

for i in range(1,n+1):
  name,score = map(int,input().split())
  a.append([name,-int(score),i])
  
a.sort()
for n,s,idx in a:
  print(idx)
 


### FIXED CODE ###

a = []
n = int(input())

for i in range(1,n+1):
  name,score =input().split()
  a.append([name,-int(score),i])
  
a.sort()
for n,s,idx in a:
  print(idx)
N = int(input())
edges = [[] for i in range(N)]
e_list = []

for i in range(N-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    e_list.append((a,b))
    edges[a].append((b,i))
    edges[b].append((a,i))

ans = [0] * (N-1)

def dfs(v, p=-1, c=-1): #親p(はじめはいないので-1), 子がv, 親の色も渡す必要あり
    # 子が次の子孫をグラフから探す
    global ans
    next_v = edges[v]
    cnt = 1 # num of colors
    for u,i in next_v:
        # 子孫の中には親もいて、それは除外
        if u == p: continue
        # 子供に対しては自分が親となり、同様のことをする
        if cnt == c:
            cnt += 1
        ans[i] = cnt      
        cnt += 1
        dfs(u, v, ans[i])

dfs(0)
for a in ans:
    print(a)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
N = int(input())
edges = [[] for i in range(N)]
e_list = []

for i in range(N-1):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    e_list.append((a,b))
    edges[a].append((b,i))
    edges[b].append((a,i))

ans = [0] * (N-1)

def dfs(v, p=-1, c=-1): #親p(はじめはいないので-1), 子がv, 親の色も渡す必要あり
    # 子が次の子孫をグラフから探す
    global ans
    next_v = edges[v]
    cnt = 1 # num of colors
    for u,i in next_v:
        # 子孫の中には親もいて、それは除外
        if u == p: continue
        # 子供に対しては自分が親となり、同様のことをする
        if cnt == c:
            cnt += 1
        ans[i] = cnt      
        cnt += 1
        dfs(u, v, ans[i])


dfs(0)
print(max(ans))
for a in ans:
    print(a)
N = int(input())
A = 1
for _ in range(N):
    A = A * int(input())

print(A)

### FIXED CODE ###

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

if A.count(0) >= 1:
    print(0)
    exit()

answer = 1
for _ in A:
    answer *= _
    if answer > 1000000000000000000:
        print('-1') 
        exit()

print(answer)
s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print(len(s)*k//2)
elif s[0] == s[len(s)-1]:
    for i in range(1,len(l)-1):
        c2 = c2 + l[i]//2
    print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)

### FIXED CODE ###

s = input()
k = int(input())
c = 1
i = 1
l = []
c2 = 0
while i < len(s):
    if i == len(s)-1:
        if s[i] == s[i-1]:
            c = c+1
            l.append(c)
            i = i+1
        else:
            l.append(c)
            l.append(1)
            i = i+1
    elif s[i] == s[i-1]:
        c = c + 1
        i = i + 1
    else:
        l.append(c)
        c = 1
        i = i+1
if len(l) == 1:
    print((len(s)*k)//2)
elif s[0] == s[len(s)-1]:
    if len(s)==1:
        print(k//2)
    else:
        for i in range(1,len(l)-1):
            c2 = c2 + l[i]//2
        print(c2*k+((l[0]+l[len(l)-1])//2)*(k-1)+l[0]//2+l[len(l)-1]//2)
else:
    for i in range(0,len(l)):
        c2 = c2 + l[i]//2
    print(c2*k)
N, A, B = map(int, input().split())
sum = 0
for 1 in range(N + 1):
  if i % 10 >= A and i % 10 <= B:
    sum += i
print(sum)

### FIXED CODE ###

N, A, B = map(int, input().split())
ret = 0
for i in range(N + 1):
  v = sum(map(int, list(str(i))))
  if v >= A and v <= B:
    ret += i
print(ret)
# https://atcoder.jp/contests/abc088/tasks/abc088_d

from collections import deque

def solve(R, C, sy, sx, gy, gx, mz):
  queue = deque()
  checked = set( )
  queue.append((sx, sy, 0))
  while queue:
    x, y, n = queue.popleft()
    if x == gx and y == gy:
      return n
    if x < 1 or x > C or y < 1 or y > R or mz[y-1][x-1] == '#':
      continue
    if (x, y) in checked:
      continue
    checked.add((x, y))
    queue.append((x+1, y, n+1))
    queue.append((x-1, y, n+1))
    queue.append((x, y+1, n+1))
    queue.append((x, y-1, n+1))
    


if __name__ == '__main__':
  R, C = map(int, input().split(' '))
  sy, sx = 1, 1
  gy, gx = R, C
  mz = []
  whites = 0
  for r in range(R):
    tmp = input()
    mz.append(tmp)
    whites += tmp.count('.')
  n = solve(R, C, sy, sx, gy, gx, mz)
  print(whites - n - 1)

### FIXED CODE ###

# https://atcoder.jp/contests/abc088/tasks/abc088_d

from collections import deque

def solve(R, C, sy, sx, gy, gx, mz):
  queue = deque()
  checked = set( )
  queue.append((sx, sy, 0))
  while queue:
    x, y, n = queue.popleft()
    if x == gx and y == gy:
      return n
    if x < 1 or x > C or y < 1 or y > R or mz[y-1][x-1] == '#':
      continue
    if (x, y) in checked:
      continue
    checked.add((x, y))
    queue.append((x+1, y, n+1))
    queue.append((x-1, y, n+1))
    queue.append((x, y+1, n+1))
    queue.append((x, y-1, n+1))
  return -1


if __name__ == '__main__':
  R, C = map(int, input().split(' '))
  sy, sx = 1, 1
  gy, gx = R, C
  mz = []
  whites = 0
  for r in range(R):
    tmp = input()
    mz.append(tmp)
    whites += tmp.count('.')
  n = solve(R, C, sy, sx, gy, gx, mz)
  if n < 0:
    print(-1)
  else:
    print(whites - n - 1)
from sys import stdin
import math


def main():
    A, B, C, D = [int(x) for x in stdin.readline().rstrip().split()]

    C_D = (C * D) // math.gcd(C, D)

    z = B//C_D - A//C_D

    if A % C == 0:
        x = (B//C)+1 - (A//C)
    else:
        x = (B//C) - A//C

    y = B//D - A//D

    # print(x, y, z)

    print((B-A+1)-(x+y-z))


if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import stdin
import fractions


def main():
    A, B, C, D = [int(x) for x in stdin.readline().rstrip().split()]

    C_D = (C * D) // fractions.gcd(C, D)

    z = B//C_D - A//C_D

    if A % C == 0:
        x = (B//C) - (A//C) + 1
    else:
        x = (B//C) - (A//C)

    y = B//D - A//D

    print((B-A+1)-(x+y-z))


if __name__ == "__main__":
    main()
N, M = list(map(int, input().split()))

questions = [False] * N
ac_count = penalty_count = 0
P = []
S = []

for _ in range(M):
    p, s = list(input().split())
    p = int(p) - 1

    P.append(p)
    S.append(s)

    if s == 'AC':
        questions[p] = True

for i in range(M):
    if S[P[i]] == 'WA' and questions[P[i]]:
            penalty_count += 1

print(sum(questions), penalty_count)


### FIXED CODE ###

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

is_solved = [False] * N
wa_count = [0] * N
wa_total = 0

for _ in range(M):
    p, s = list(input().split())
    p = int(p) - 1

    if s == 'AC':
        if not is_solved[p]:
            is_solved[p] = True
            wa_total += wa_count[p]
    else:
        wa_count[p] += 1

print(sum(is_solved), wa_total)
int(input())
A = [list(map(int,input().split())) for i in list(range(N))]
B = [[i[0]+i[1], i[0]-i[1]] for i in A]
B.sort()
prev=B[0]
cnt=N
for i in range(1,N):
  if prev[0]<B[i][1]:
    nt-=1
  else:
    prev=B[i]
print(cnt)  


### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    XL = [None] * N
    for n in range(N):
        X, L = map(int,input().split())
        XL[n] = [X-L,X+L]
    XL.sort(key=lambda x:x[1])
    ret = 1
    TMP = XL[0][1]
    for x in XL[1:]:
        if TMP<=x[0]:
            TMP = x[1]
            ret += 1
    print(ret)

if __name__ == '__main__':
    main()
a, b, c = map(int, input().split())

if a = b:
  input(c)
elif b = c:
  input(a)
else:
  input(b)

### FIXED CODE ###

a, b, c = map(int, input().split())

if a == b:
  print(c)
elif b == c:
  print(a)
else:
  print(b)
a,b,c,d=map(int,input().split())

if a/d>c/b:
    print('Yes')
elif a/d==c/b:
	if c/b>0 and a/d==0
		print('No')
	else:
    	print('Yes')
elif a/d+1==c/b:
    if c%b==0 and a%d!=0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
x=a//d
y=c//b
if y<x:
    print('Yes')
elif y==x:
    if c%b==0:
        print('Yes')
    else:
        if a%d==0:
            print('No')
        else:
            print('Yes')
            
elif y==x+1:
    if c%b==0:
        print('Yes')
    else:
        print('No')
            
else:
    print('No')
n = int(input())
a = list(map(int, input().split()))
count = 0
outs = []
max_a = max(a)
max_index = a.index(max(a))
min_a = min(a)
min_index = a.index(min(a))
flag = -1
if 0 <= min_a:
  flag = 0
elif max_a <= 0:
  flag = n
elif max_a > -1 * min_a:
  flag = 0
  for i in range(0,n):
    if a[i] < 0:
      a[i] += max_a
      outs.append(str(max_index + 1) + " " + str(i + 1))
      count += 1
elif max_a < -1 * min_a:
  flag = n
  for i in range(0,n):
    if a[i] > 0:
      a[i] += min_a
      outs.append(str(min_index + 1) + " " + str(i + 1))
      count += 1

if flag == 0:
  for i in range(0, n-1):
    a[i+1] += a[i]
    outs.append(str(i + 1) + " " + str(i + 1 + 1))
    count += 1
elif flag == n:
  for i in range(0, n-1):
    a[n-i-1] += a[n-i]
    outs.append(str(n - i + 1) + " " + str(n - i - 1 + 1))
    count += 1
    
print(count)
for out in outs:
  print(out)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
count = 0
outs = []
max_a = max(a)
max_index = a.index(max(a))
min_a = min(a)
min_index = a.index(min(a))
flag = -1
if 0 <= min_a:
  flag = 0
elif max_a <= 0:
  flag = n
elif max_a > -1 * min_a:
  flag = 0
  for i in range(0,n):
    if a[i] < 0:
      a[i] += max_a
      outs.append(str(max_index + 1) + " " + str(i + 1))
      count += 1
elif max_a <= -1 * min_a:
  flag = n
  for i in range(0,n):
    if a[i] > 0:
      a[i] += min_a
      outs.append(str(min_index + 1) + " " + str(i + 1))
      count += 1

if flag == 0:
  for i in range(0, n-1):
    a[i+1] += a[i]
    outs.append(str(i + 1) + " " + str(i + 1 + 1))
    count += 1
elif flag == n:
  for i in range(1, n):
    a[n-i-1] += a[n-i]
    outs.append(str(n - i + 1) + " " + str(n - i - 1 + 1))
    count += 1
    
print(count)
for out in outs:
  print(out)
s=str(input())
for i in s:
    if s[i]==",":
        s=s[:i]+" "+s[i+1:]
print(s)

### FIXED CODE ###

s=str(input())
for i in range(len(s)):
    if s[i]==",":
        s=s[:i]+" "+s[i+1:]
print(s)