Harryxun/stf_run huggingface dataset:
def non_decreasing(N: int, A: list) -> list:
    res = []

    # まず、A の値を正か負に統一する。
    # なので、A に正と負の値が混在する場合のみ、min(A) と max(A)
    # の絶対値の大きい方を全体に足す。
    min_a, max_a = min(A), max(A)
    min_i, max_i = A.index(min_a), A.index(max_a)

    if min_a * max_a < 0:
        # 正と負の値が混在するのでどちらかに統一する。
        # ここの操作は N-1 回。
        if abs(min_a) < abs(max_a):
            # max_a を全体に加えて正の値のみにし、単調増加
            # するように修正する。
            res = [(max_i + 1, i + 1) for i in range(N) if i != max_i]
            for i in range(N):
                if i != max_i:
                    A[i] += max_a
            min_a += max_a
        else:
            # min_a を全体に加えて負の値のみにし、絶対値が
            # 単調減少するように修正する。
            res = [(min_i + 1, i + 1) for i in range(N) if i != min_i]
            for i in range(N):
                if i != min_i:
                    A[i] += min_a
            max_a += min_a

    # この操作が N-1 回。
    if max_a < 0:
        # 全体が負の値なので、絶対値が単調減少するように N 番目の値から
        # 始めて i 番目の値を i-1 番目の値に足していく。
        res += [(i, i - 1) for i in range(N, 1, -1)]
        for i in range(N-1, 0, -1):
            A[i - 1] += A[i]

    else:
        # 全体が正の値なので、単調増加するように 1 番目の値から始めて i
        # 番目の値を i+1 番目の値に足していく。
        res += [(i, i + 1) for i in range(1, N)]
        for i in range(0, N - 1):
            A[i + 1] += A[i]

    # print(A)
    if abs(A[N - 1]) > 10 ** 6:
        raise Exception('')

    return res


if __name__ == "__main__":
    N = int(input())
    A = [int(s) for s in input().split()]
    ans = non_decreasing(N, A)
    print(len(ans))
    for x, y in ans:
        print(x, y)


### FIXED CODE ###

def non_decreasing(N: int, A: list) -> list:
    res = []

    # まず、A の値を正か負に統一する。
    # なので、A に正と負の値が混在する場合のみ、min(A) と max(A)
    # の絶対値の大きい方を全体に足す。
    min_a, max_a = min(A), max(A)
    min_i, max_i = A.index(min_a), A.index(max_a)

    if min_a * max_a < 0:
        # 正と負の値が混在するのでどちらかに統一する。
        # ここの操作は N-1 回。
        if abs(min_a) < abs(max_a):
            # max_a を全体に加えて正の値のみにし、単調増加
            # するように修正する。
            res = [(max_i + 1, i + 1) for i in range(N) if i != max_i]
            for i in range(N):
                if i != max_i:
                    A[i] += max_a
            min_a += max_a
        else:
            # min_a を全体に加えて負の値のみにし、絶対値が
            # 単調減少するように修正する。
            res = [(min_i + 1, i + 1) for i in range(N) if i != min_i]
            for i in range(N):
                if i != min_i:
                    A[i] += min_a
            max_a += min_a

    # この操作が N-1 回。
    if max_a <= 0:
        # 全体が負の値なので、絶対値が単調減少するように N 番目の値から
        # 始めて i 番目の値を i-1 番目の値に足していく。
        res += [(i, i - 1) for i in range(N, 1, -1)]
        for i in range(N-1, 0, -1):
            A[i - 1] += A[i]

    else:
        # 全体が正の値なので、単調増加するように 1 番目の値から始めて i
        # 番目の値を i+1 番目の値に足していく。
        res += [(i, i + 1) for i in range(1, N)]
        for i in range(0, N - 1):
            A[i + 1] += A[i]

    # print(A)

    return res


if __name__ == "__main__":
    N = int(input())
    A = [int(s) for s in input().split()]
    ans = non_decreasing(N, A)
    print(len(ans))
    for x, y in ans:
        print(x, y)
h, w = map(int, input().split())
s = [list('#' * (w + 2))]
dot = 0
for i in range(h):
    s.append(['#'] + list(input()) + ['#'])
    dot += s[-1].count('.')
s.append(list('#' * (w + 2)))


def walk(y, x, l):
    for i in [[1, 0], [0, 1], [-1, 0], [0, -1]]:
        dy = y + i[0]
        dx = x + i[1]
        if s[dy][dx] == '.':
            s[dy][dx] = l + 1
            walk(dy, dx, l + 1)
        elif s[dy][dx] != '#':
            if s[dy][dx] > l+1:
                s[dy][dx] = l + 1
                walk(dy, dx, l + 1)

s[1][1] = 1
walk(1, 1, 1)
if s[h][w] == '.':
    print(-1)
else:
    print(dot - s[h][w])


### FIXED CODE ###

h, w = map(int, input().split())
s = [list('#' * (w + 2))]
queue = [[1, 1, 1]]
dot = 0
for i in range(h):
    s.append(['#'] + list(input()) + ['#'])
    dot += s[-1].count('.')
s.append(list('#' * (w + 2)))

def move(yxc):
    y, x, cost = yxc[0], yxc[1], yxc[2]
    global queue
    for dy, dx in ([1, 0], [-1, 0], [0, 1], [0, -1]):
        ny, nx = y + dy, x + dx
        if s[ny][nx] == '.':
            s[ny][nx] = cost + 1
            queue.append([ny, nx, cost + 1])

while len(queue) > 0:
    move(queue.pop(0))

s[1][1] = 1
move([1, 1, 1])
if s[h][w] == '.':
    print(-1)
else:
    print(dot - s[h][w])
# https://beta.atcoder.jp/contests/agc014/submissions/1268295
import sys

input = sys.stdin.readline().rstrip()


def solve():
    H, W, K = map(int, input().split())
    a = [[False for _ in range(W)] for _ in range(H)]
    visited = [[False for _ in range(W)] for _ in range(H)]

    sy, sx = -1, -1
    for r in range(H):
        s = input()
        for c, x in enumerate(s):
            if x == '.':
                a[r][c] = True
            elif x == 'S':
                a[r][c] = True
                sy, sx = r, c

    q = [(sy, sx, 0)]
    t = max(W, H)
    n = 1
    i = 0
    while n > 0:
        r, c, k = q[i]
        n -= 1
        visited[r][c] = True

        t = min(t, r, H - 1 - r, c, W - 1 - c)

        if t == 0:
            print(1)
            return

        for dr, dc in (-1, 0), (1, 0), (0, -1), (0, 1):
            nr, nc = r + dr, c + dc
            if 0 <= nr < H and 0 <= nc < W and a[nr][nc] and not visited[nr][nc] and k + 1 <= K:
                q.append((nr, nc, k + 1))
                n += 1
        i += 1

    ans = 1 + (t + K - 1) // K

    print(ans)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

# https://beta.atcoder.jp/contests/agc014/submissions/1268295
from collections import deque

dr = (0, 1, 0, -1)
dc = (1, 0, -1, 0)


def solve():
    H, W, K = map(int, input().split())
    a = [[False for _ in range(W)] for _ in range(H)]

    sy, sx = -1, -1
    for r in range(H):
        s = input()
        for c, x in enumerate(s):
            if x == '.':
                a[r][c] = True
            elif x == 'S':
                a[r][c] = True
                sy, sx = r, c

    visited = [[False for _ in range(W)] for _ in range(H)]
    visited[sy][sx] = True

    t = max(H, W)
    q = deque([(sy, sx, 0)])
    while q:
        r, c, k = q.popleft()

        t = min(t, r, H - 1 - r, c, W - 1 - c)
        # print(t)
        if t == 0:
            print(1)
            return

        for d_i in range(4):
            nr, nc = r + dr[d_i], c + dc[d_i]
            if 0 <= nr < H and 0 <= nc < W and a[nr][nc] and not visited[nr][nc] and k + 1 <= K:
                visited[nr][nc] = True
                q.append((nr, nc, k + 1))

    ans = 1 + (t + K - 1) // K

    print(ans)


if __name__ == '__main__':
    solve()
n = int(input())
p = ''
d = []
for _ in range(n):
  w = input()
  if p and p[-1] == w[0]
    print('No')
    exit()
  if w in d:
    print('No')
    exit()
  p = w[-1]
  d[w] = 1
print('Yes')
  

### FIXED CODE ###

n = int(input())
p = ''
d = {}
for _ in range(n):
  w = input()
  if p and p[-1] != w[0]:
    print('No')
    exit()
  if w in d:
    print('No')
    exit()
  p = w[-1]
  d[w] = 1
print('Yes')
#include <iostream>
#include <vector>
using namespace std;

int main() {
    vector<int> ll; 
    int n;
	cin >> n;
    for(int i=0; i<n; i++) {
    	int x;
    	cin >> x;
    	ll.push_back(x);
    }
    long long ans = 0;
    for(int i=0; i<n; i++) {
        for(int j=i+1; j<n; j++) {
            for(int k=j+1; k<n; k++) {
                if(ll[i] < ll[j] + ll[k] && ll[j] < ll[i] + ll[k] && ll[k] < ll[i] + ll[j]) {
                    ans += 1;
                }
            }
        }
    }
    cout << ans << '\n';
    
}

### FIXED CODE ###

# coding: utf-8
# Your code here!

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

ll.sort()
ans = 0
for i in range(n - 2):
    for j in range(i+1, n - 1):
        lb = j + 1
        ub = n - 1
        b = ll[i] + ll[j]
        if ll[lb] >= b:
            continue
        if ll[ub] < b:
            ans += ub - lb + 1
            continue
        while True:
            if ub == lb:
                ans += ub - j
                break
            t = (lb + ub) // 2 + 1
            if ll[t] < b:
                lb = t
            else:
                ub = t - 1
print(ans)
# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

# 再起回数上限変更
# sys.setrecursionlimit(1000000)
N = int(input())
data = defaultdict(int)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a, b = (0,0)はそれを入れるのみなので，
# カウントから抜かして(a,b)の数を最後に足せば良い
# どちらかが0の場合は，
# a=0ならb=0のモノが対比となる

cnt_zero = 0

for i in range(N):
    a, b = map(int, input().split())
    div = gcd(abs(a), abs(b))

    # マイナスはaだけ
    if a <0 and b <0:
        a, b = -a, -b
    elif b < 0:
        a, b = -a, -b

    if a ==0 and b==0:
        cnt_zero += 1
        continue

    if a ==0:
        data[(0, 1)] += 1
        data[(1, 0)] += 0
        continue

    if b ==0:
        data[(1, 0)] += 1
        data[(0, 1)] += 0
        continue

    data[(a//div, b//div)] += 1
    if a > 0:
        data[(-b//div, a//div)] += 0
    else:
        data[(b // div, -a // div)] += 0

mod = 1000000007
res = 1


for d in data:
    if d[0]>=0 and d[1]>=0:
        val = data[d]
        a1 = data[(-d[1], d[0])]
        # print(d, val, a1)
        if val == 0:
            res *= pow(2, a1, mod)
        elif a1 > 0:
            res *= pow(2, val, mod) + pow(2, a1, mod) - 1
            data[(-d[1], d[0])] = 0
        else:
            res *= pow(2, val, mod)
        res %= mod
        # print(res)


print(res+cnt_zero-1)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect

# 再起回数上限変更
# sys.setrecursionlimit(1000000)
N = int(input())
data = defaultdict(int)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a, b = (0,0)はそれを入れるのみなので，
# カウントから抜かして(a,b)の数を最後に足せば良い
# どちらかが0の場合は，
# a=0ならb=0のモノが対比となる

cnt_zero = 0

for i in range(N):
    a, b = map(int, input().split())
    div = gcd(abs(a), abs(b))

    # マイナスはaだけ
    if a <0 and b <0:
        a, b = -a, -b
    elif b < 0:
        a, b = -a, -b

    if a ==0 and b==0:
        cnt_zero += 1
        continue

    if a ==0:
        data[(0, 1)] += 1
        data[(1, 0)] += 0
        continue

    if b ==0:
        data[(1, 0)] += 1
        data[(0, 1)] += 0
        continue

    data[(a//div, b//div)] += 1
    if a > 0:
        data[(-b//div, a//div)] += 0
    else:
        data[(b // div, -a // div)] += 0

mod = 1000000007
res = 1


for d in data:
    if d[0]>0 and d[1]>0:
        val = data[d]
        a1 = data[(-d[1], d[0])]
        # print(d, val, a1)
        if val == 0:
            res *= pow(2, a1, mod)
        elif a1 > 0:
            res *= pow(2, val, mod) + pow(2, a1, mod) - 1
            data[(-d[1], d[0])] = 0
        else:
            res *= pow(2, val, mod)
        res %= mod
        # print(res)
    # aが0の場合
    if d[0]==0:
        val = data[d]
        a1 = data[(1, 0)]

        if val == 0:
            res *= pow(2, a1, mod)
        elif a1 > 0:
            res *= pow(2, val, mod) + pow(2, a1, mod) - 1
        else:
            res *= pow(2, val, mod)
        res %= mod

print((res+cnt_zero-1)%mod)
m=10**9+7
i=s=r=0
f=1
*a=open(0).read().split()
for x in a[1:]:i+=1;s+=pow(i,m-2,m);r+=int(x)*~-s+int(a[-i])*s;f=f*i
print(r*f%m)


### FIXED CODE ###

m=10**9+7
i=s=r=0
f=1
_,*a=open(0).read().split()
for x in a:i+=1;s+=pow(i,m-2,m);r+=int(x)*~-s+int(a[-i])*s;f=f*i%m
print(r*f%m)
A,B,K=[int(i) for i in input().split()]
a=[]
for i in range(1,max(A,B)):
  if A%i==0 and B%i==0:
    a.append(i)
print(a[-k])
  

### FIXED CODE ###

A,B,K=[int(i) for i in input().split()]
a=[]
for i in range(1,max(A,B)+1):
  if A%i==0 and B%i==0:
    a.append(i)
print(a[-K])
from itertools import combinations

N,T=[int(x) for x in input().split()]
towns=list([int(x) for x in input().split()])

com=combinations(list(range(0,N)),2)

bene=[]
for c in com:
    bene.append(towns[c[1]]-towns[c[0]])

max_bene=max(bene)
print(len([item for item in [x for x in bene if x==max_bene]]))

### FIXED CODE ###

candies=[int(x) for x in input().split()]
candies.sort()
if candies[2]==(candies[0]+candies[1]):
    print("Yes")
else:
    print("No")
n = int(input())
s, t = map(int, input().split())

for i, j in zip(s, t):
  print(s+t, end='')
  
print()

### FIXED CODE ###

n = int(input())
s, t = input().split()

for i, j in zip(s, t):
  print(i+j, end='')
  
print()
N , W = map(int,input().split())
dp[] = [0]*(W+1)

for i in range(N):
    n , m = map(int,input().split())
    for j in range(W,m-1,-1):
        x = n + dp[j-m]
        if x >= dp[j]:
            dp[j] = x
            
print(dp[W])


### FIXED CODE ###

N , W = map(int,input().split())
dp = [0]*(W+1)

for i in range(N):
    n , m = map(int,input().split())
    for j in range(W,m-1,-1):
        x = n + dp[j-m]
        if x >= dp[j]:
            dp[j] = x
            
print(dp[W])
from math import PI
r=int(input())
print(2*PI*r)

### FIXED CODE ###

from math import pi
r=int(input())
print(2*pi*r)
N, P = map(int, input().split())
if N == 1:
  print(P)
  exit()
if N > 40:
  print(1)
  exit()
res = []
for i in range(P):
  x = i**N
  if i**N > P:
    break
  if P%x == 0:
    res.append(i)
print(max(res))
  

### FIXED CODE ###

N, P = map(int, input().split())
if N == 1:
  print(P)
  exit()
if N > 40:
  print(1)
  exit()
res = []
for i in range(1,P+1):
  x = i**N
  if i**N > P:
    break
  if P%x == 0:
    res.append(i)
print(max(res))
n, a, b = map(int, input().split(' '))

if a == 0:
    print(0)
elif b == 0:
    print(n)
else:
    blue = (n // (a + b)) * a
    amari = n % (a+b)
    if amari > a:
        blue += a
    else:
        blue += amari

    print(blue)


### FIXED CODE ###

a = input()
if len(set(a)) > 1:
    print('Yes')
else:
    print('No')
from math import gcd
N, M = map(int, input().split())
S = list(map(int, input().split()))

temp = S[0]
for i in range(1, N):
    temp = temp*S[i]//gcd(temp, S[i])
if temp//2 > M:
    print(0)
else:
    print((M-temp//2)//temp+1)

### FIXED CODE ###

from fractions import gcd
N, M = map(int, input().split())
S = list(map(int, input().split()))

temp = S[0]
cnt = 0
while temp%2 == 0:
    temp //= 2
    cnt += 1
temp = S[0]
for i in range(1, N):
    temp = temp*S[i]//gcd(temp, S[i])
    if S[i]%(2**cnt) == 1 or (S[i]//(2**cnt))%2 == 0:
        print(0)
        break
else:      
    if temp//2 > M:
        print(0)
    else:
        print((M-temp//2)//temp+1)
import sys
import math
import itertools
import numpy

rl = sys.stdin.readline

n, m = map(int, rl().split())
li = [[] for _ in range(m)]
for _ in range(m):
  a, b = map(int, rl().split())
  a -= 1
  b -= 1
  li[a].append(b)
  li[b].append(a)

marks = [-1]*n
stack = [0]
while stack:
    for next_room in li[stack[0]]:
        if marks[next_room] == -1:
            stack.append(next_room)
            marks[next_room] = stack[0]
    del stack[0]
if -1 in stack:
  print('No')
else:
  print('Yes')
  for i in marks[1:]:
    print(i+1)


### FIXED CODE ###

import sys
import math
import itertools
import numpy

rl = sys.stdin.readline

n, m = map(int, rl().split())
li = [[] for _ in range(m+1)]
for _ in range(m):
  a, b = map(int, rl().split())
  a -= 1
  b -= 1
  li[a].append(b)
  li[b].append(a)

marks = [-1]*n
stack = [0]
while stack:
    for next_room in li[stack[0]]:
        if marks[next_room] == -1:
            stack.append(next_room)
            marks[next_room] = stack[0]
    del stack[0]
if -1 in marks:
  print('No')
else:
  print('Yes')
  for i in marks[1:]:
    print(i+1)
import numpy as np

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

next = np.zeros((N, N))

for i in range(M):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    next[u][v] = 1

s, t = map(int, input().split())
s -= 1
t -= 1

next = np.dot(next, np.dot(next, next))
for i in range(N):
    next[i][i] = 0

now = t
step = 0
check_list = [[now, step]]
ok = False
check = [False] * N
while len(check_list) > 0:
    now, step = check_list.pop(0)
    if now == s:
        print(step)
        ok = True
        break
    for i in range(N):
        if next[i][now] > 0:
            if not check[i]:
                check_list.append([i, step+1])
                check[i] = True
if not ok:
    print(-1)


### FIXED CODE ###

N, M = map(int, input().split())
nodes = [[] for i in range(N)]

for i in range(M):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    nodes[u].append(v)

s, t = map(int, input().split())
s -= 1
t -= 1

num = s
step = 0
q = [[num, step]]
check = [[False for i in range(N)] for j in range(3)]
ok = False
while len(q) > 0:
    num, step = q.pop(0)
    tmp = step % 3
    if tmp == 0 and num == t:
        print(step//3)
        ok = True
        break
    for next in nodes[num]:
        if not check[tmp][next]:
            check[tmp][next] = True
            q.append([next, step+1])
if not ok:
    print(-1)
turu = 2
kame = 4
flag =0

for x in range(a + 1):
    for y in range(a + 1):
        if turu * x + kame * y == b and x + y <= a:
            flag += 1

if flag == 0:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

# 動物の数がX匹、　足の総数がY本
X,Y = map(int,input().split())
#print(X,Y)
turu = 2
kame = 4
flag = False
for i in range(0, X + 1): # 0, 1, 2, 3
    #print("亀が{0}匹の場合".format(i))
    turu_num = X - i
    #print("鶴は{0}匹".format(turu_num))
    leg_total = kame * i + turu_num * turu
    #print("足の総数は{0}".format(leg_total))
    if(leg_total == Y):
      flag = True
      break
#    for q in range(0, X - i + 1):
#        print("鶴は{0}匹".format(q))
#        if kame * i + turu * q == Y and (i + q) <= X:
#            flag += 1
if flag:
    print("Yes")
else:
    print("No")
def drawone(f):
    v = list(range(1,11))
    for i in f:
        v.remove(i)
    win = 0
    lose= 0
    for i in v:
        if i + sum(f[:2]) <= 20:
            win += 1
        else:
            lose += 1
    return(True if win>=lose else False)

while True:
    f = list(map(int,input().strip().split()))
    if drawone(f):
        print('YES')
    else:
        print('NO')

### FIXED CODE ###

def drawone(f):
    v = list(range(1,11))
    for i in f:
        v.remove(i)
    win = 0
    lose= 0
    for i in v:
        if i + sum(f[:2]) <= 20:
            win += 1
        else:
            lose += 1
    return(True if win>=lose else False)

while True:
    try:
        f = list(map(int,input().strip().split()))
        if drawone(f):
            print('YES')
        else:
            print('NO')
    except EOFError:
        break
# encoding: utf-8

P_MAX = 100

num_and_pnt = lambda x: [int(x[0]), int(x[1]) // 100]

def mycounter(item, G):
    Gtmp = (item[1] + 1) * item[2] + item[3]
    p_th = item[2]
    for i in range(item[2]):
        if Gtmp < G: break
        else:
            p_th -= 1
            Gtmp = (item[1] + 1) * p_th
    return p_th + 1

D, G = num_and_pnt(input().split())

# [flag, index, pi, ci]
pc = [[1, i] + num_and_pnt(input().split()) for i in range(D)]

cnt = 0
while True:
    # last point

    state = -1
    p_tmp = P_MAX
    for item in filter(lambda x: x[0] > 0, pc):
        Gtmp = (item[1] + 1) * item[2] + item[3]
        if G <= Gtmp:
            p = mycounter(item, G)
            if p < p_tmp:
                state = item[1]
                p_tmp = p
    # escape
    if state > -1:
        cnt += p_tmp
        # print("#", (state + 1) * 100, p_tmp)
        break
    # completed point
    item = max(list(filter(lambda x: x[0] > 0, pc)), key=lambda x: x[1] + x[3] / x[2])
    G -= (item[1] + 1) * item[2] + item[3]
    cnt += item[2]
    pc[item[1]][0] = 0
    # print("#", (item[1] + 1) * 100, item[2], G)
    
print(cnt)

### FIXED CODE ###

# encoding: utf-8
D_MAX = 10
P_MAX = 100

num_and_pnt = lambda x: [int(x[0]), int(x[1]) // 100]
D, G = num_and_pnt(input().split())
# [pi, ci]
pc = [num_and_pnt(input().split()) for i in range(D)]

G_list = [(i + 1) * x[0] + x[1] for i, x in enumerate(pc)]
cnt_list = [x[0] for i, x in enumerate(pc)]
idx = [map(int, format(i, "b")) for i in range(2 ** D)]

# i, G_comp, cnt_comp
table = [ (i, sum([((i // (2 ** j)) % 2) * G_list[j] for j in range(D)]), sum([((i // (2 ** j)) % 2) * cnt_list[j] for j in range(D)])) for i in range(2 ** D)] # very long
# print(table)
mincnt = D_MAX * P_MAX
for i, (G_last, cnt_last) in enumerate(zip(G_list, cnt_list)):
    for j, G_comp, cnt_comp in filter(lambda x: (((x[0] // (2 ** i)) % 2 == 0) and (x[1] <= G < x[1] + G_last) and (x[2] < mincnt)), table):
        # print(i, (G_last, cnt_last), j, G_comp, cnt_comp)
        cnt_last_tmp = min((-((G_comp - G) // (i + 1)), cnt_last))
        if cnt_comp + cnt_last_tmp < mincnt: mincnt = cnt_comp + cnt_last_tmp

print(mincnt)
N, R = input().split()

if N<10:
  print(R+100*(10-N))
else:
  print(N)

### FIXED CODE ###

N, R = map(int, input().split())

ans = 100*(10-N)+R
if N>=10:
  print(R)
else:
  print(ans)
a = int(input())
my_result = a + a**2 + a ***3
my_result

### FIXED CODE ###

a = int(input())
my_result = a + a**2 + a**3
print(my_result)
#D - Not Divisible
import collections
N = int(input())
a = list(map(int,input().split()))
a = sorted(a,reverse = False)

#collections.Counterは存在しない値を指定すると0を返す
cnt = collections.Counter(a)
m = max(a)+1
for i in a:
    if cnt[i] >= 2:
        del cnt[i]
    for j in range(i*2,m,i):
        del cnt[j]
print(len(cnt.keys()))

### FIXED CODE ###

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

print(a.index(0) + 1)
s = input()

s.append("X")
pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

print(mx)


### FIXED CODE ###

s = input()

s += "X"
pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

print(mx)
import sys
input = sys.stdin.readline

mod = 998244353


NN = 10**4 # 使うデータによって変える

inv = [0]
for i in range(1, NN):
    inv.append(pow(i, mod-2, mod))

def main():
    A, B, C, D = map(int, input().split())
    dp = [[0]*(D+1) for _ in range(C+1)]
    dp2 = [[0]*(D+1) for _ in range(C+1)]


    for w in range(B-1, D+1):
        dp[A][w] = 0
        dp2[A][w] = pow(A, (D-B), mod)


    for c in range(A+1, C+1):
        t = pow(c*inv[c-1] % mod, D-B-1, mod)
        kakeru = (c-1)*inv[c] % mod
        dp[c][B] = pow(B,c-A,mod) * pow(c, D-B, mod) % mod
        dp2[c][B] = dp[c][B]
        for d in range(B+1, D+1):
            dp[c][d] = (dp2[c-1][d-1] + dp[c-1][d]*d % mod ) * t % mod
            t = t * kakeru % mod
            dp2[c][d] = (dp2[c][d-1] + dp[c][d]) % mod

    print(dp2[C][D])


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

mod = 998244353


NN = 10**4 # 使うデータによって変える

inv = [0]
for i in range(1, NN):
    inv.append(pow(i, mod-2, mod))

def main():
    A, B, C, D = map(int, input().split())
    dp = [[0]*(D+1) for _ in range(C+1)]
    dp2 = [[0]*(D+1) for _ in range(C+1)]


    for w in range(B-1, D+1):
        dp[A][w] = 0
        dp2[A][w] = pow(A, (D-B), mod)


    for c in range(A+1, C+1):
        if D - B - 1 >= 0:
            t = pow(c*inv[c-1] % mod, D-B-1, mod)
        kakeru = (c-1)*inv[c] % mod
        dp[c][B] = pow(B,c-A,mod) * pow(c, D-B, mod) % mod
        dp2[c][B] = dp[c][B]
        for d in range(B+1, D+1):
            dp[c][d] = (dp2[c-1][d-1] + dp[c-1][d]*d % mod ) * t % mod
            t = t * kakeru % mod
            dp2[c][d] = (dp2[c][d-1] + dp[c][d]) % mod

    print(dp2[C][D])


if __name__ == "__main__":
    main()
s = int(input())

x1 = 0
y1 = 0
x2 = int(s ** 0.5)
y3 = -(-s // x2)
x3 = 1
y2 = x2 * y3 - s
if y3 > 10 ** 9:
    a
print(x1, y1, x2, y2, x3, y3)


### FIXED CODE ###

s = int(input())

x1 = 0
y1 = 0
x2 = int(s ** 0.5)
y3 = -(-s // x2)
x3 = 1
if y3 > 10 ** 9:
    x2 += 1
    y3 = -(-s // x2)
y2 = x2 * y3 - s
print(x1, y1, x2, y2, x3, y3)
n, m = map(int,inpout().split())
print((n - 1) + (m * 1))

### FIXED CODE ###

n, m = map(int,input().split())
print((n - 1) * (m - 1))