Harryxun/stf_run huggingface dataset:
import math
N = int(input())
ran = math.floor(math.sqrt(N))
max = 0
for i in range(１、ran):
    if N%i == 0:
        if i > max:
            max = i
print(i + N/i -2)

### FIXED CODE ###

n = int(input())
s = int(n ** 0.5)
i = 0
while True:
    if n%(s + i) == 0:
        k = 1
        break
    if n%(s - i) == 0:
        k = -1
        break
    i += 1
s = s + i * k 
print((s + n // s) - 2)
N, M = map(int,input().split())
s = [0]*M
c = [0]*M

for i in range(M):
    s[i], c[i] = map(int,input().split())

ans = [0]*M
ans[0] = 1
error = 0

assign = [0]*M
for i in range(M):
    assign[s[i]- 1] += 1

    if assign[s[i] - 1] > 1 and ans[s[i] - 1] != c[i]:
        error += 1

    ans[s[i] - 1] = c[i]
    


if ans[0] == 0:
    error += 1 

if error == 0:
    for i in range(M):
        print(ans[i], end = "")
    print()
else:
    print(-1)


### FIXED CODE ###

N, M = map(int,input().split())
s = [0]*M
c = [0]*M

for i in range(M):
    s[i], c[i] = map(int,input().split())

ans = [0]*N
if N != 1:
    ans[0] = 1
error = 0

assign = [0]*N
for i in range(M):
    assign[s[i]- 1] += 1

    if assign[s[i] - 1] > 1 and ans[s[i] - 1] != c[i]:
        error += 1

    ans[s[i] - 1] = c[i]
    


if ans[0] == 0 and N != 1:
    error += 1 

if error == 0:
    for i in range(N):
        print(ans[i], end = "")
    print()
else:
    print(-1)
s = input()
????
for i in range(int(input())):
????????cmd = input().split()
????????a,b = [int(x) for x in cmd[1:3]]
????
????????if cmd[0] == 'print':
????????????????print(s[a:b+1])
????????elif cmd[0] == 'reverse':
????????????????s = s[:a] + s[a:b+1][::-1] + s[b+1:]
????????elif cmd[0] == 'replace':
????????????????s = s[:a] + cmd[3] + s[b+1:]

### FIXED CODE ###

s=input()
for i in range(int(input())):
    sou_com=input().split()
    if sou_com[0]=='print':
        print(s[int(sou_com[1]):int(sou_com[2])+1])
    elif sou_com[0]=='reverse':
        s=s[:int(sou_com[1])]\
        +s[int(sou_com[1]):int(sou_com[2])+1][::-1]\
        +s[int(sou_com[2])+1:]
    elif sou_com[0]=='replace':
        s=s[:int(sou_com[1])]\
        +sou_com[3]\
        +s[int(sou_com[2])+1:]
#1以上N以下の整数のうち、10進法で各桁の和がA以上B以下であるものについて総和
  
n=int(input())
a=int(input())
b=int(input())
 
def s(x):
        return x//10000 + x%10000//1000 + x%1000//100 + x%100//10 + x%10
 
sum=0
 
for i in range(n+1):
        if a<=int(s(i))<=b:
                sum+=i
 
print(sum)

### FIXED CODE ###

#1以上N以下の整数のうち、10進法で各桁の和がA以上B以下であるものについて総和
  
n,a,b=map(int,input().split())
def s(x):
        return x//10000 + x%10000//1000 + x%1000//100 + x%100//10 + x%10

sum=0

for i in range(n+1):
        if a<=int(s(i))<=b:
                sum+=i

print(sum)
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<ll, P> E;
#define MOD (1000000007ll)
#define l_ength size
#define PI 3.14159265358979

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

int main(void){
	int n,m,i,j,ans=0,tmp;
	string s[123],t[123];
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> s[i];
	}
	cin >> m;
	for(j=0; j<m; ++j){
		cin >> t[j];
	}
	for(i=0; i<n; ++i){
		tmp = 0;
		for(j=0; j<n; ++j){
			if(s[i] == s[j]){
				++tmp;
			}
		}
		for(j=0; j<m; ++j){
			if(s[i] == t[j]){
				--tmp;
			}
		}
		ans = max(ans,tmp);
	}
	cout << ans << endl;
	return 0;
}


### FIXED CODE ###

n,s = int(input()),[]
for i in range(n):
	s.append(input())
m,t = int(input()),[]
for i in range(m):
	t.append(input())
ans = []
for i in range(n):
	ans.append(0)
	for j in range(n):
		if s[i] == s[j]:
			ans[i] += 1
	for j in range(m):
		if s[i] == t[j]:
			ans[i] -= 1
ans.append(0)
print(max(ans))
import math
N = int(input())
t = []
for i in range(N):
  t.append(list(map(int,input().split())))
at = []
for i in range(N):
    for j in range(N):
        ea = math.sqrt((t[i][0] - t[j][0])**2 + (y[i][1] - y[j][1])**2)
        at.append(ea)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)

### FIXED CODE ###

import math
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
at=[]
for i in range(N):
    for j in range(N):
        ea = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
        at.append(ea)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)
m=24*60*60
while True:
	n=int(input())
	if n==0:break
#	dp=[0]*(m+1)
	for _ in range(n):
		a,d=input().split()
#		a,b,c=map(int,a.split(':'));
#		d,e,f=map(int,d.split(':'));
#		dp[a*3600+b*60+c]+=1
#		dp[d*3600+e*60+f]-=1
#	for i in range(m):
#		dp[i+1]+=dp[i]
#	print(max(dp))

### FIXED CODE ###

m=24*60*60
while True:
	n=int(raw_input())
	if n==0:break
	dp=[0]*(m+1)
	for _ in range(n):
		a,d=raw_input().split()
		a,b,c=map(int,a.split(':'));
		d,e,f=map(int,d.split(':'));
		dp[a*3600+b*60+c]+=1
		dp[d*3600+e*60+f]-=1
	for i in range(m):
		dp[i+1]+=dp[i]
	print(max(dp))
from math import floor
A, B , N = map(int, input().split())
List = []
for x in range(N+1):
    Answer = floor((A*x)/B) - (A*floor(x/B))
    List.append(Answer)
# print(List)
print(max(List))

### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())
check = 0
for i in range(A, B+1):
    if i % K == 0:
        print("OK")
        check = 1
        break
if check == 0:
    print("NG")
a=input("");
flag=False;
for i in xrange(0,len(a)-2):
  if a[i]=='A' and a[i+1]=='C':
    flag=True;
if flag==True:
  print("Yes");
else:
  print("No");


### FIXED CODE ###

a=input("");
flag=False;
for i in range(0,len(a)-1):
  if a[i]=='A' and a[i+1]=='C':
    flag=True;
if flag==True:
  print("Yes");
else:
  print("No");
import numpy as np
n = int(input())
a = list(map(int,input().split()))
mat = np.matrix([np.zeros(n) for i in range(n)])
for i in range(n-1):
    mat[i,i] = 1/2
    mat[i,i + 1] = 1/2
mat[n-1,0] = 1/2
mat[n-1,n-1] = 1/2

ans = np.linalg.inv(mat) * np.matrix(a).T
anss = []
for i in range(n):
    anss.append(int(ans[i,0]))
print(*anss)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
 
m = [0]*n
m[0] = sum(a)
 
for i in range((n-1)//2):
	m[0] -= 2*(a[1+i*2])
 
for i in range(1,n):
	m[i] = 2*a[i-1] - m[i-1]
 
print(' '.join(map(str, m)))
from collections import Counter

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

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

for i in range(n):
    if V[0] != V[i]:
        break
    elif i == n - 1:
        print(min(len(Veven), len(Vodd)))
        exit()


Voc = Counter(Vodd)
Vec = Counter(Veven)

if Vodd == Veven:
    if Voc.most_common()[1][1] - Voc.most_common()[0][1] > Vec.most_common()[1][1] - Vec.most_common()[0][1]:
        num = Voc.most_common()[0][1] + Vec.most_common()[1][1]
else:
    num = Voc.most_common()[0][1] + Vec.most_common()[0][1]


print(n - num)


### FIXED CODE ###

from collections import Counter

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

Vodd = V[: len(V):2]
Veven = V[1: len(V):2]

Voc = Counter(Vodd)
Vec = Counter(Veven)

Voc_val, Voc_cnt = zip(*Voc.most_common())
Vec_val, Vec_cnt = zip(*Vec.most_common())

Voc_val, Voc_cnt = list(Voc_val), list(Voc_cnt)
Vec_val, Vec_cnt = list(Vec_val), list(Vec_cnt)

num = Voc.most_common()[0][1] + Vec.most_common()[0][1]

if Voc_val[0] == Vec_val[0]:
    Voc_cnt.append(0)
    Vec_cnt.append(0)
    num += max(Voc_cnt[1] - Voc_cnt[0], Vec_cnt[1] - Vec_cnt[0])

print(n - num)
N,M = map(int,input().split())
a = [list(map(int,input().split())) for i in range(N)]

A = [x[0] for x in a]
A_sorted = sorted(A)
ans = 0
nokori = M
for c in A_sorted:
	for j in range(N):
		if c == A[j]:
			ans += A[j]*min(a[1][j],nokori)
			nokori -= min(a[1][j],nokori)
		if nokori <= 0:
			print(ans)
			exit()


### FIXED CODE ###

N,M = map(int,input().split())
a = [list(map(int,input().split())) for i in range(N)]
a.sort(key=lambda x:x[0])
ans = 0
nokori = M
for j in range(N):
	ans += a[j][0]*min(a[j][1],nokori)
	nokori -= a[j][1]
	if nokori <= 0:
		print(ans)
		exit()
def main():
  n=int(input())
  a=sorted(map(int,input().split()))
  maxa=a[-1]+1
  tf=[False]*maxa
  r=0
  n-=1
  for i in range(n):
    a_i=a[i]
    if tf[a_i] ==False:
      for j in range(a_i,maxa,a_i):
        tf[j]=True
      if a_i < a[i+1]:
        r+=1
  if tf[n] ==False:
    r+=1
  print(r)
main()

### FIXED CODE ###

def main():
  n=int(input())
  a=sorted(map(int,input().split()))
  maxa=a[-1]+1
  tf=[False]*maxa
  r=0
  n-=1
  for i in range(n):
    a_i=a[i]
    if tf[a_i] ==False:
      for j in range(a_i,maxa,a_i):
        tf[j]=True
      if a_i < a[i+1]:
        #print(a_i)
        r+=1
  if tf[-1] ==False:
    r+=1
  print(r)
main()
#include<vector>
#include<iostream>
#include<algorithm>
#include<numeric>
using namespace std;
int main()
{
    int N, M;
    cin >> N >> M;
    vector<long long int> A(N);
    for(int i = 0; i<N; i++) {
        cin >> A.at(i);
    }
    for(int j = 0; j<M; j++) {
        long long int b, c;
        cin >> b >> c;
        vector<long long int> x(b,c);
        A.insert(A.end(), x.begin(), x.end());
    }
    sort(A.begin(), A.end(), std::greater<long long int>());
    cout << accumulate(A.begin(), A.begin()+N, 0LL) << endl;
    return 0;
}

### FIXED CODE ###

from collections import defaultdict
inf = input().split()
N = int(inf[0])
W = int(inf[1])
dic = defaultdict(int)

line = input().split()

for a in line:
    dic[int(a)] += 1

for w in range(W):
    inf = input().split()
    b = int(inf[0])
    c = int(inf[1])
    dic[c] += b
    
keys = list(dic.keys())

keys.sort(reverse=True)

count = 0
ans = 0
for k in keys:
    while dic[k]>0:
        if count == N:
            break
        ans += k
        dic[k] -= 1
        count += 1
    if count == N:
        break

print(ans)
n = int(input())

rate = 600
rank = 8

while true:
    if n < rate:
        print(rank)
        break
    rate += 200
    rank -= 1

### FIXED CODE ###

n = int(input())

if n < 600:
    print(8)
elif n < 800:
    print(7)
elif n < 1000:
    print(6)
elif n < 1200:
    print(5)
elif n < 1400:
    print(4)
elif n < 1600:
    print(3)
elif n < 1800:
    print(2)
elif n < 2000:
    print(1)
N, M = map(int, input().split())
S = [0]*M
C = [0]*M
SC = {1: set([]), 2: set([]), 3: set([])}
for m in range(M):
    S[m], C[m] = map(int, input().split())
    SC[S[m]].add(C[m])

ANS = [0]*N
out = 0
for i in range(1, 4):
    if len(SC[i]) >= 2:
        out = 1
if out == 1:
    print(-1)

else:
    if N == 1:
        if list(SC[1])[0] == 0:
            out = 1
        elif len(SC[1]) == 0:
            ANS[0] = 0
        else:
            ANS[0] = list(SC[1])[0]

    else:
        for i in range(N):
            if i == 0:
                if list(SC[i+1])[0] == 0:
                    out = 1
                elif len(SC[i+1]) == 0:
                    ANS[0] = 1
                else:
                    ANS[0] = list(SC[i+1])[0]
            else:
                if len(SC[i+1]) == 0:
                    ANS[i] = 0
                else:
                    ANS[i] = list(SC[i+1])[0]
    if out == 1:
        print(-1)
    else:
        ans = 0
        for i in range(N):
            ans += ANS[i]*10**(N-i-1)
        print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
S = [0]*M
C = [0]*M
SC = {}
SC = {1: set([]), 2: set([]), 3: set([])}
for m in range(M):
    S[m], C[m] = map(int, input().split())
    SC[S[m]].add(C[m])

ANS = [0]*N
out = 0
for i in range(1, 4):
    if len(SC[i]) >= 2:
        out = 1
if out == 1:
    print(-1)

else:
    out = 0
    if N == 1:
        if len(SC[1]) == 0:
            ANS[0] = 0
        else:
            ANS[0] = list(SC[1])[0]

    else:
        for i in range(N):
            if i == 0:
                if len(SC[i+1]) == 0:
                    ANS[0] = 1
                elif list(SC[i+1])[0] == 0:
                    out = 1
                else:
                    ANS[0] = list(SC[i+1])[0]
            else:
                if len(SC[i+1]) == 0:
                    ANS[i] = 0
                else:
                    ANS[i] = list(SC[i+1])[0]
    if out == 1:
        print(-1)
    else:
        ans = 0
        for i in range(N):
            ans += ANS[i]*10**(N-i-1)
        print(ans)
n,m=map(int,input().split())
a=list(map(int,input().split()))
count=0
for i in range(int(n)):
    if a[i]<sum(a)//(4*int(m)):
        count=count
    else:
        count+=1
if count>=int(m):
    print("Yes")
else:
    print("No")
        

### FIXED CODE ###

x,y,z=map(str,input().split())
print(z+" "+x+" "+y)
a,b,k = map(int,input().split())
l = list(range(a,b+1))
newl = list(set(l[:k] + l[-k:]))

for i in newl:
  print(i)

### FIXED CODE ###

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

if (b-a)//2 + 1 <= k:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)
import math
import fractions
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1


n=input1()
X=input_array()

min_p=min(X)
max_p=max(X)
b_p=10000
p=[]
for i in range(min_p,max_p):
	s=0
	for j in X:
		s+=(j-i)**2
	p.append(s)
	# if s>b_p:
	# 	break
	# else:
	# 	b_p=s
print(min(p))





### FIXED CODE ###

import math
import fractions
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1


n=input1()
X=input_array()

min_p=min(X)
max_p=max(X)
b_p=10000
p=[]
for i in range(min_p,max_p):
	s=0
	for j in X:
		s+=(j-i)**2
	p.append(s)
	# if s>b_p:
	# 	break
	# else:
	# 	b_p=s

if p==[]:
	print(0)
else:
	print(min(p))
for _ in range(N):
    A.append(int(input()))
    
for i in range(N):
    if A[i] >= a:
        b = a
        a = A[i]
    elif A[i] > b:
        b = A[i]
 
for i in range(N):
    if A[i] < a:
        print(a)
    else:
        print(b)

### FIXED CODE ###

N = int(input())
A = []
 
for _ in range(N):
    A.append(int(input()))
    
a = max(A)
b =  sorted(A)[-2]
 
for i in range(N):
    if A[i] < a:
        print(a)
    else:
        print(b)
N = int(input())
T = []
for i in range(N):
  T.append(list(map(int, input().split())))

dp = [-1]*N

def dfs(i, prev):
    if i >= N:
      return 0
    maxp = -99999999
    for j in range(3):
      if prev == j:
        continue
      maxp = max(maxp, dfs(i+1, j) + T[i][j])
    return maxp

print(dfs(0,-1))

### FIXED CODE ###

N= int(input())
X = [list(map(int, input().split())) for _ in range(N)]
L = 3
dp = [[0 for _ in range(3)] for _ in range(N+1)]

dp[0] = [0,0,0]
for i in range(N):
  dp[i+1] = [max([dp[i][k] for k in range(L) if k != j]) + X[i][j] for j in range(L)]

print(max(dp[-1]))
from collections import deque

h, w = map(int, input().split())
a = [input() for _ in range(h)]

d = [[-1] * w for _ in range(h)]


def bfs():
    s = []
    for i in range(h):
        for j in range(w):
            if a[i][j] == "#":
                s.append([i, j])

    q = deque()
    for sx, sy in s:
        q.append([sx, sy])
        d[sy][sx] = 0
    dxy = [[1, 0], [-1, 0], [0, 1], [0, -1]]

    while q:
        ux, uy = q.popleft()
        for dx, dy in dxy:
            vx = ux + dx
            vy = uy + dy
            if 0 <= vx <= w - 1 and 0 <= vy <= h - 1 and a[vy][vx] == "." and d[vy][vx] == -1:
                d[vy][vx] = d[uy][ux] + 1
                q.append([vx, vy])


bfs()

ans = 0
for row in d:
    for e in row:
        ans = max(ans, e)

print(ans)


### FIXED CODE ###

from scipy.ndimage import distance_transform_cdt


def main():
    h, w = map(int, input().split())
    a = [list(input()) for _ in range(h)]

    sq = [[1 if e == "." else 0 for e in row] for row in a]

    cnt = distance_transform_cdt(sq, metric="taxicab")

    print(cnt.max())


if __name__ == "__main__":
    main()
from math import gdc
K=int(input())
ans=0 
 
for i in range(1,K+1):
  for j in range(1,K+1):
    for l in range(1,K+1):
      ans+= gcd(gcd(i,j),l)
 
print(ans)

### FIXED CODE ###

from math import gcd
K=int(input())
ans=0 
 
for i in range(1,K+1):
  for j in range(1,K+1):
    for l in range(1,K+1):
      ans+= gcd(gcd(l,j),i)
 
print(ans)
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')
a = input()
b1 = int(a[0:2])
c2 = int(a[2:4])
henkan(b1,c2)


### FIXED CODE ###

a = int(input())
y = a//100
m = a%100
if 1 <= y <= 12 and 1 <= m <= 12:
	print('AMBIGUOUS')
elif 1 <= y <= 12:
	print('MMYY')
elif 1 <= m <= 12:
	print('YYMM')
else:
	print('NA')
from sys import stdin
import numpy as np


def main():
    n, m = list(map(int, stdin.readline().split()))
    hList = list(map(int, stdin.readline().split()))
    ABList = [list(map(int, stdin.readline().split())) for _ in range(m)]
    hRelations = np.zeros((n, n))
    for a, b in ABList:
        if hList[a-1] >= hList[b-1]:
            hRelations[b-1, a-1] = 1
        if hList[b-1] >= hList[a-1]:
            hRelations[a-1, b-1] = 1
    total = 0
    print(total)
    for hRelation in hRelations:
        if hRelation.sum() == 0:
            total += 1
    print(total)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from sys import stdin
import numpy as np


def main():
    n, m = list(map(int, stdin.readline().split()))
    hList = list(map(int, stdin.readline().split()))
    ABList = [list(map(int, stdin.readline().split())) for _ in range(m)]
    maxHeights = np.zeros(n)
    for a, b in ABList:
        if hList[a-1] >= maxHeights[b-1]:
            maxHeights[b-1] = hList[a-1]
        if hList[b-1] >= maxHeights[a-1]:
            maxHeights[a-1] = hList[b-1]
    total = 0
    i = 0
    for maxHeight in maxHeights:
        if maxHeight < hList[i]:
            total += 1
        i += 1
    print(total)


if __name__ == '__main__':
    main()
class unionFind:
    parent = []

    def __init__(self, N):
        self.parent = [i for i in range(N)]

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            return
N,M=map(int,input().split())
G=unionFind(M)
s=set()
for i in range(N):
  tmp=tuple(map(int,input().split()))
  s|=set(tmp[1:])
  for x in tmp[2:]:
    G.unite(tmp[1],x)

parent=set()
for i in s:
  parent.add(G.root(i-1))

if len(parent)==1:
  print("YES")
else:
  print("NO")
      

### FIXED CODE ###

class unionFind:
    parent = []

    def __init__(self, N):
        self.parent = [i for i in range(N)]

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            return
N,M=map(int,input().split())
G=unionFind(M)
s=set()
for i in range(N):
  tmp=tuple(map(int,input().split()))
  s.add(tmp[1]-1)
  for x in tmp[2:]:
    G.unite(tmp[1],x)

parent=set()
for i in s:
  parent.add(G.root(i))

if len(parent)==1:
  print("YES")
else:
  print("NO")
input = int(input())

hour = input // 3600
minute = input - 3600 * hour
second = hour - 60 * minute

print( hour ':' minute ':' second )

### FIXED CODE ###

sec_ = int(input())
print("{}:{}:{}".format(sec_//3600, (sec_//60)%60, sec_%60))
import sys
import math
def input(): return sys.stdin.readline().rstrip()

def main():
    a, b= map(int, input().split())
    print(a * b // math.gcd(a, b))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import fractions
def input(): return sys.stdin.readline().rstrip()

def main():
    a, b= map(int, input().split())
    print(a * b // fractions.gcd(a, b))

if __name__ == '__main__':
    main()
import numpy as np
import itertools
import matplotlib as mpl

x1, y1, x2, y2 =map(int, input().split())  #複数数値入力

x3 = y1-y2+x2
y3 = x2-x1+y2
x4 = y1-y2+x1
y4 = x2-x1+y1

L = [x3,y3,x4,y4]
print(' '.join(map(str, L)))

### FIXED CODE ###

import numpy as np

x1, y1, x2, y2 =map(int, input().split())  #複数数値入力

x3 = y1-y2+x2
y3 = x2-x1+y2
x4 = y1-y2+x1
y4 = x2-x1+y1

L = [x3,y3,x4,y4]
print(' '.join(map(str, L)))
import sys
input = sys.stdin.readline
N,M = map(int, input().split())
A = list(map(int, input().split()))  # -> li = [1,2,3,...n]
C = [[0,0] for _ in range(M)]
for i in range(M):
    b,c = map(int, input().split())
    C[i][0] = c
    C[i][1] = b
A = sorted(A, reverse=True)
C = sorted(C, reverse=True)
cnt = 0
s = 0
ai = 0
ci = 0
while cnt < N:
    aa = A[ai]
    cc = C[ci][0]
    if aa > cc:
        s += aa
        ai += 1
    else:
        s += cc
        C[ci][1] -= 1
        if C[ci][1] == 0:
            ci += 1
    cnt += 1
print(s)


### FIXED CODE ###

import sys
input = sys.stdin.readline
N,M = map(int, input().split())
A = list(map(int, input().split()))  # -> li = [1,2,3,...n]
C = [[0,0] for _ in range(M)]
for i in range(M):
    b,c = map(int, input().split())
    C[i][0] = c
    C[i][1] = b
A = sorted(A, reverse=True)
C = sorted(C, reverse=True)
cnt = 0
s = 0
ai = 0
ci = 0
while cnt < N:
    aa = A[ai]
    if ci >= M:
        cc = 0
    else:
        cc = C[ci][0]
    if aa > cc:
        s += aa
        ai += 1
    else:
        s += cc
        C[ci][1] -= 1
        if C[ci][1] == 0:
            ci += 1
    cnt += 1
print(s)
import heapq
N, M = map(int, input().split())
jobs = {m:[] for m in range(1,M+1) }

for i in range(N):
  hi,yen = map(int, input().split())
  jobs[hi].append(yen)
  
q = []
ans = 0
for i in range(1,M+1):
  for j in jobs[i]:
    heapq.heappush(q, -j)
  if len(q) > 0:
    a = heapq.heappop(q)
    ans += -a  
print(ans)

### FIXED CODE ###

import heapq
N, M = map(int, input().split())
jobs = {m:[] for m in range(1,M+1) }

for i in range(N):
  hi,yen = map(int, input().split())
  if hi <= M:
    jobs[hi].append(yen)
  
q = []
ans = 0
for i in range(1,M+1):
  for j in jobs[i]:
    heapq.heappush(q, -j)
  if len(q) > 0:
    a = heapq.heappop(q)
    ans += -a  
print(ans)
n = int(input())
S = input()

ANS = ''
for s in S:
    if ord(s) + n < ord('Z'):
        ANS += chr(ord(s) + n)
    else:
        ANS += chr(ord(s) + n -26(ord(s) + n)%26)
print(ANS)

### FIXED CODE ###

n = int(input())
S = input()

ANS = ''
for s in S:
    if ord(s) + n <= ord('Z'):
        ANS += chr(ord(s) + n)
    else:
        ANS += chr(ord(s) + n -26)
print(ANS)
a,b=map(int,input().split())
3 5
x=a*b
y=2*a+2*b
print(a b)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,2*(a+b))