Harryxun/stf_run huggingface dataset:
import math
N=int(input())
X=float(N)/1.08
if X%1==0.0:
    print(int(X))
else:
    Y=math.floor(X)
    if math.floor(Y*1.08)==N or math.floor((Y-1)*1.08)==N:
        print(Y)
    else:
        print(":(")

### FIXED CODE ###

a=list(map(int, input().split()))
b=list(map(int, input().split()))
ou=b[0]-a[0]
if ou == 1:
  print(1)
elif ou==0:
  print(0)
elif ou==1-12:
  print(1)
else:
  print(0)
def main():
    x = int(input())
    
    x // 500 = a
    x %= 500

    x // 5 = b
    
    ans = 1000 * a + 5 * b
    print(ans)

main()




### FIXED CODE ###

def main():
    x = int(input())
    
    a = x // 500
    x %= 500

    b = x // 5
    
    ans = 1000 * a + 5 * b
    print(ans)

main()
n = int(input())
A = list(map(int,input().split()))

def main(i):
  a = count(A.count(i))
  print(a)


for i in range(1,n+1):
  main(i)

### FIXED CODE ###

from collections import Counter
n = int(input())
A = list(map(int,input().split()))

mycounter = Counter(A)

for i in range(1,n+1):
  print(mycounter[i])
input = map(int, [input()] + input().split(' '))
[k,start,end] = input

for i in range(start, end + 1):
  if i % k == 0:
    return True
return False



### FIXED CODE ###

k = int(input())
(start, end) = map(int, input().split())


for i in range(start, end+1):
  if i % k == 0:
    print('OK')
    exit(0)
print('NG')
N,M=map(int,input().split())
b=[]
s=[0]*M
for i in range(N):
    a=list(map(int,input().split()))
    del a[0]
    a.sort()
    b.append(a)
for i in range(N):
    for j in range(len(b[i])):
        s[b[i][j]]+=1
print(s.count(N))

### FIXED CODE ###

N,M=map(int,input().split())
b=[]
s=[0]*M
for i in range(N):
    a=list(map(int,input().split()))
    del a[0]
    a.sort()
    b.append(a)
for i in range(N):
    for j in range(len(b[i])):
        s[b[i][j]-1]+=1
print(s.count(N))
n, m = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(n):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] == True
      c[1] += 1
print(c[1], c[0])

### FIXED CODE ###

n, m = map(int, input().split())
l = [False] * n
c = [0] * n
ans = [0, 0]
for i in range(m):
  p, r = map(str, input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[int(p) - 1] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      ans[0] += c[int(p) - 1]
      ans[1] += 1
print(ans[1], ans[0])
n=input()
n=int(n)
val=list(map(int,input().strip().split(' ')))
val.sort()
res=0
if len(val)>0:
    if len(val)==1:
        print(val[0]/2)
    elif len(val)==2:
        print(sun(val)/2)
    else:
        #res=(val[0]+val[1])/2
        res=(val[0]+val[1])/2
        for i in range(2,len(val)):
            res=(res+val[i])/2
            #print(res)
        print(res)
else:
    #print('error')
    pass

### FIXED CODE ###

n=input().strip()
n=int(n)
if n>=2 and n<=50:
    num=list(map(int,input().strip().split()))
num.sort()

if n==2:
    print(sum(num)/2)
else:
    num.append((num[0]+num[1])/2)
    num=num[2:]
    for i in range(len(num)-1):
        num.append((num[-1]+num[0])/2)
        num=num[1:]
    print(num[-1])
#!/usr/bin/env python3
import sys
import bisect
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, M: int):
    ds = []
    for i in range(1, int(ceil(sqrt(M)))):
        if M % i == 0:
            ds.append(i)
            ds.append(M // i)
    ds.sort()
  
    th = M // N
    return ds[bisect.bisect(ds, th)-1]


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    result = solve(N, M)
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import bisect
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, M: int):
    ds = []
    for i in range(1, int(ceil(sqrt(M))) + 1):
        if M % i == 0:
            ds.append(i)
            ds.append(M // i)
    ds.sort()
  
    th = M // N
    return ds[bisect.bisect(ds, th)-1]


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    result = solve(N, M)
    print(result)

if __name__ == '__main__':
    main()
n,a = map(int,input().split())
x = list(map(int,input().split()))
dp = []
for i in range(n+1):
    dp.append([[] for j in range(i+1)])
    for k in range(i+1):
        dp[i][k] = [0 for y in range(50*k)]
for i in range(n+1):
        dp[i][0].append(0)
for i in range(1,n+1):
    for j in range(1,i+1):
        if j == 1:
                dp[i][j][x[i-1]-1] += 1
        for k in range(len(dp[i-1][j-1])):
                dp[i][j][k+x[i-1]] += dp[i-1][j-1][k]
                dp[i][j-1][k] += dp[i-1][j-1][k]
count = 0
for j in range(1,i+1):
        for k in range(len(dp[i][j])):
                if k + 1 == j*a:
                        count += dp[n][j][k]
print(count)

### FIXED CODE ###

n,a = map(int,input().split())
x = list(map(int,input().split()))
dp = []
for i in range(n+1):
    dp.append([[] for j in range(i+1)])
    for k in range(i+1):
        dp[i][k] = [0 for y in range(50*k)]
for i in range(n+1):
        dp[i][0].append(0)
for i in range(1,n+1):
    for j in range(1,i+1):
        if j == 1:
                dp[i][j][x[i-1]-1] += 1
        for k in range(50*(j-1)):
                dp[i][j][k+x[i-1]] += dp[i-1][j-1][k]
                dp[i][j-1][k] += dp[i-1][j-1][k]
count = 0
for j in range(1,i+1):
        for k in range(len(dp[i][j])):
                if k + 1 == j*a:
                        count += dp[n][j][k]
print(count)
n,k=map(int,input().split())
step=list(map(int,input().split()))
dp=[0]*n
for i in range(1,k):
  min=10**7
  for j in range(1,i):
    if abs(step[i]-step[i-j])<min:
      dp[i]=abs(step[i]-step[i-j])
for i in range(k,n):
  min=10**7
  for j in range(1,k):
    if abs(step[i]-step[i-j])<min:
      dp[i]=abs(step[i]-step[i-j])
print(dp[n-1])

### FIXED CODE ###

def solve():
  n,k=[int(i) for i in input().split()]
  step=[int(i) for i in input().split()]
  dp=[0]*n
  for i in range(1,n):
    dp[i]=min([dp[j] + abs(step[i]-step[j]) for j in range(max(i-k,0),i)])
  return dp[n-1]
print(solve())
N = int(input())

List = sorted(list(set(list(int(input()) for i in range(N)))))

print(len(List()))


### FIXED CODE ###

i = int(input())
List = []
for j in range(i):
    List.append(int(input()))
print(len(set(List)))
s = input()
k,a = int(input()),list()
for c in range(len(s)):
    if s[c] == "1":
        k -= 1
        if k < 0:
            print(1)
            break
    else:
        a.append(s[c])
print(a[0])

### FIXED CODE ###

s = input()
k = int(input())
for c in range(min(len(s),k)):
    if s[c] != "1":
        print(s[c])
        exit()
print(1)
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08)
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1)

if a_max < b_min or b_max < a_min:
  print(-1)
else:
  result = b_min if a_min <= b_min else a_min
  print(result)

### FIXED CODE ###

s = list(input())

if len(list(set(s))) != 1:
  print('Yes')
else:
  print('No')
import math
N = int(input())
#距離の箱を作成
kyori = []
kyori2 = []
kyori3 = []
sumation = 0
for i in range(N):
    #N回繰り返す
    kyori.append(list(map(int,input().split())))
#x間の距離、y間の距離を算出
#ここで、2→1と1→2などは同じ距離なので計算しない
x_distance = 0
y_distance = 0
for i in range(0,N):
    for j in range(i+1,N):
        x_distance = (kyori[i][0]-kyori[j][0])**2
        y_distance = (kyori[i][1]-kyori[j][1])**2
        #xとyの距離を計算(sqrt導出)
        Kyorixy = math.sqrt(x_distance + y_distance)
        kyori2.append(Kyorixy)
if len(kyori2) == 1:
    print(kyori2[0])
else:
   goukei = sum(kyori2)*2/N

### FIXED CODE ###

n = int(input())
print(int(n**2))
S = input()
l = len(S)
num = 0
for i in range(n):
  if S[i] == '+':
    num = num +1
  else :
    num = num -1
print(num)

### FIXED CODE ###

S = input()
l = len(S)
num = 0
for i in range(l):
  if S[i] == '+':
    num = num +1
  else :
    num = num -1
print(num)
N.a,b=map(int,input().split())
sho,ama=divmod(N,a+b)
print(N*sho+min(ama,a))

### FIXED CODE ###

N,A,B = map(int, input().split())
sho,ama=divmod(N,A+B)
print(A*sho+min(ama,A))
inp = list(map(int, input().split()))

A = inp[0]
B = inp[1]
K = inp[2]

# 約数を求める
yakusuu_a = []
yakusuu_b = []

for i in range(1,A):
    if A % i == 0:
        yakusuu_a.append(i)

for i in range(1,B):
    if B % i == 0:
        yakusuu_b.append(i)

c = []
for i in yakusuu_a:
  if i in yakusuu_b:
    c.append(i)

c.sort()
if len(c) == 0:
  print(1)
else:
  print(c[K-1])

### FIXED CODE ###

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

A = inp[0]
B = inp[1]
K = inp[2]

# 約数を求める
yakusuu_a = []
yakusuu_b = []

for i in range(1,A+1):
    if A % i == 0:
        yakusuu_a.append(i)

for i in range(1,B+1):
    if B % i == 0:
        yakusuu_b.append(i)

c = []
for i in yakusuu_a:
  if i in yakusuu_b:
    c.append(i)

c.sort(reverse=True)
if len(c) == 0:
  print(1)
else:
  print(c[K-1])
import math

def lcm(x, y):
    return (x*y)//math.gcd(x,y)

A, B = [int(i) for i in input().split(" ")]

print(lcm(A, B))

### FIXED CODE ###


def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if 0==x%y:
        return y
    else:
        while not 0==x%y:
            z = x%y
            x = y
            y = z
        return z

def lcm(x, y):
    return (x*y)//gcd(x,y)

A, B = [int(i) for i in input().split(" ")]

print(lcm(A, B))
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a = 0
b = 0
k = 0

for i in itertools.permutations(range(1,n+1)):
    k += 1
    if i == p:
        a = k
    if i == q:
        b = k
ans = abs(a-b)
print(ans)

### FIXED CODE ###

from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

k, x = map(int, input().split())
ans = 'No'
if 500 * k >= x:
    ans = 'Yes'

print(ans)
list = [A, B, C]
if list.sort() == [5, 5, 7]:
  return 'Yes'
else:
  return 'No'
   

### FIXED CODE ###

L = sorted(map(int, input().split()))
 
ans = 'YES' if L == [5, 5, 7] else 'NO'
print(ans)
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N=<K:
  print(N*X)
else:
  print(K*X)+(N-K)*Y

### FIXED CODE ###

N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N<=K:
  print(int(N*X))
else:
  print(int((K*X)+(N-K)*Y))
n,k = map(int(), input().split())
ans = 2*k+1
if ans > n:
  print(“No”)
else:
  print(“Yes”)


### FIXED CODE ###

n,k = map(int, input().split())
ans = 2*k-1
if n < ans:
  print('NO')
else:
  print('YES')
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
a.sort(reverse=True)

if n > 1:
    a.append(0)
    biggest = a[0]
    now = 0
    while m > 0:
        a[now] = a[now]//2
        m -= 1
        biggest = a[0]
        for i in range(n-1):
            if a[i+1] >= biggest and m > 0:
                a[i+1] = a[i+1]//2
                m -= 1
            else:
                a.sort(reverse=True)
                break
    else:
        break

else:
  for j in range(m):
    a[0] //= 2

print(sum(a))

### FIXED CODE ###

n, m = map(int, input().split())
a = [int(i) for i in input().split()]
a.sort(reverse=True)

if n > 1:
    a.append(0)
    biggest = a[0]
    now = 0
    while m > 0:
        a[now] = a[now]//2
        m -= 1
        biggest = a[0]
        for i in range(n-1):
            if a[i+1] >= biggest and m > 0:
                a[i+1] = a[i+1]//2
                m -= 1
            else:
                a.sort(reverse=True)
                break
    else:
        quit

else:
  for j in range(m):
    a[0] //= 2

print(sum(a))
import sys

args = sys.args[1::]
numbers = [int(s) for s in args]

if sorted(numbers) == [5, 5, 7]:
  return 'YES'
else:
  return 'No'


### FIXED CODE ###

import sys

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

if sorted(args) == [5, 5, 7]:
  print('YES')
else:
  print('NO')
n = int(input())
h = list(map(int,input().split()))
a = int(input())
def getNearestValue(h, a):
	idx = np.abs(np.asarray(h) - a).argmin()
	return h[idx]
print(getNearestValue(h, a))


### FIXED CODE ###

n = int(input())
mylist = list(map(int,input().split()))
mylist = sorted(mylist, key=abs)
x = mylist[0] - mylist[-1]
print(abs(x))
N = int(input())
A = input().split()

L = [0 for i in range(N)]

for i in range(N):
  L[int(A[i])-1] +=1

c = 0
for i in range(N):
  n = L[i]
  if n >= 2:
    c += factorial(n) // factorial(2) // factorial(n - 2)

for i in range(N):
  n = L[A[i]-1]
  if n >= 2:
    print(c - n + 1)
  else:
      print(c)

### FIXED CODE ###

from math import factorial
import collections

N = int(input())
A = input().split()
A = [int(x) for x in A]

L = collections.Counter(A)

c = 0
for i in range(1,N+1):
    n = L[i]
    if n >=2:
        c += factorial(n) // factorial(2) // factorial(n - 2)

for k in range(N):
    c1 = c
    n = L[A[k]]
    if n >= 3:
        c1 -= n-1
    elif n == 2:
        c1 -= factorial(n) // factorial(2) // factorial(n-2)
    print(c1)
def main(A, dp, n, mod):
    if n == -1:
        return dp[0]

    if (n in A) == False: 
        dp[n] = (dp[n + 1] + dp[n + 2]) % mod
    return main(A, dp, n-1, mod)
 
N, M = map(int, input().split())
mod = 1000000007
dp = [0] * (10**5)
A = [int(input()) for _ in range(M)] 
if (N-1 in A) == False:
    dp[N], dp[N-1] = 1, 1
else:
    dp[N] = 1
ans = main(A, dp, N-2, mod)
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
mod = 1000000007
dp = [0] * (N+2)
A = set([int(input()) for _ in range(M)]) 
dp[-2] = 1

for i in range(N-1, -1, -1):
    if (i in A) == False:
        dp[i] = (dp[i + 1] + dp[i + 2]) % mod 

print(dp[0])
import math
r=int(input())
print("{0:.5f}".format(r*r*math.pi),"{0:.5f}".format(r*2*math.pi))

### FIXED CODE ###

import math
r=float(input())
print("{0:.10f}".format(r*r*math.pi),"{0:.10f}".format(r*2*math.pi))
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
agc001 D
"""

n, m = map(int, input().split())
ali = list(map(int, input().split()))

if m == 1:
    print(ali[0])
    print(2)
    print(ali[0]-1, 1)
    exit()

flag = 0
c = []
for a in ali:
    if a % 2 == 1:
        if flag == 0:
            lm = a
            flag += 1
        elif flag == 1:
            rm = a
            flag += 1
        elif flag == 2:
            print('Impossible')
            exit()
    else:
        c.append(a)

if flag == 1:
    rm = c.pop()

b = [lm+1] + c
d = [lm] + c + [rm]

if rm > 1:
    b.append(rm-1)


print(" ".join(map(str, d)))
print(len(b))
print(" ".join(map(str, b)))


### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
agc001 D
"""

n, m = map(int, input().split())
ali = list(map(int, input().split()))

if m == 1 and ali[0] == 1:
    print(1)
    print(1)
    print(1)
    exit()

if m == 1:
    print(ali[0])
    print(2)
    print(ali[0]-1, 1)
    exit()

flag = 0
c = []
for a in ali:
    if a % 2 == 1:
        if flag == 0:
            lm = a
            flag += 1
        elif flag == 1:
            rm = a
            flag += 1
        elif flag == 2:
            print('Impossible')
            exit()
    else:
        c.append(a)

if flag == 0:
    lm = c[0]
    del c[0]
    rm = c.pop()

if flag == 1:
    rm = c.pop()

b = [lm+1] + c
d = [lm] + c + [rm]

if rm > 1:
    b.append(rm-1)


print(" ".join(map(str, d)))
print(len(b))
print(" ".join(map(str, b)))
num = list(map(int, input().split()))
if sum(num) == 7:
    print(str(num[0]) + "+" + str(num[1]) + "+" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] + num[1] + num[2] - num[3] == 7:
    print(str(num[0]) + "+" + str(num[1]) + "+" + str(num[2]) + "-" + str(num[3]) + "=7")
elif num[0] + num[1] - num[2] - num[3] == 7:
    print(str(num[0]) + "+" + str(num[1]) + "-" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] + num[1] - num[2] - num[3] == 7:
    print(str(num[0]) + "+" + str(num[1]) + "-" + str(num[2]) + "-" + str(num[3]) + "=7")
elif num[0] - num[1] + num[2] + num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "+" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] - num[1] + num[2] - num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "+" + str(num[2]) + "-" + str(num[3]) + "=7")
elif num[0] - num[1] - num[2] + num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "-" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] - num[1] - num[2] - num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "-" + str(num[2]) + "-" + str(num[3]) + "=7")


### FIXED CODE ###

n = input()
num = [int(n[0]), int(n[1]), int(n[2]), int(n[3])]
if sum(num) == 7:
    print(str(num[0]) + "+" + str(num[1]) + "+" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] + num[1] + num[2] - num[3] == 7:
    print(str(num[0]) + "+" + str(num[1]) + "+" + str(num[2]) + "-" + str(num[3]) + "=7")
elif num[0] + num[1] - num[2] + num[3] == 7:
    print(str(num[0]) + "+" + str(num[1]) + "-" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] + num[1] - num[2] - num[3] == 7:
    print(str(num[0]) + "+" + str(num[1]) + "-" + str(num[2]) + "-" + str(num[3]) + "=7")
elif num[0] - num[1] + num[2] + num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "+" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] - num[1] + num[2] - num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "+" + str(num[2]) + "-" + str(num[3]) + "=7")
elif num[0] - num[1] - num[2] + num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "-" + str(num[2]) + "+" + str(num[3]) + "=7")
elif num[0] - num[1] - num[2] - num[3] == 7:
    print(str(num[0]) + "-" + str(num[1]) + "-" + str(num[2]) + "-" + str(num[3]) + "=7")
import math
import sys
import numpy

N,K = int(input())
ans = 0.000000000
for i in range(1,N+1):
    if i >= K:
        ans += 1
    else :
        ans += math.log2(K/i)/2

ans /= N
print(ans)

### FIXED CODE ###

import math
import sys
import numpy

N,K = map(int, input().split())
a = 0.000000000
b = 1
for i in range(1,N+1):
    b = 1
    if i >= K:
        a += 1/N
    else :
        tmp = i
        while tmp < K:
            tmp *= 2
            b /= 2
        a += b/N
print(a)
n=int(input().split())
lists=list(map(int,input().split())
for i in range(n):
    lists[i]-=(i+1)
mini=10**100
for k in range(-10**9,10**9,1):
    sub=0
    for i in range(n):
        sub+=abs(list[i]-k)
    mini=min(mini,sub)
           
print(mini)

### FIXED CODE ###

n=int(input())
lists=list(map(int,input().split()))
uselists=[]
for _ in range(n):
    uselists.append(lists[_]-_-1)
uselist=sorted(uselists)
if n%2==0:
    num1=int(n/2-1)
    num2=int(n/2)
    numbers=min(uselist[num1],uselist[num2])
    
if n%2!=0:
    num1=int((n-1)/2)
    numbers=uselist[num1] 
ans=0
for x in range(n):
    ans+=abs(uselist[x]-numbers)
print(ans)
n,m=map(int,input().split())
bridge=[[] for i in range(m)]
iland=[[i+1] for i in range(n)]
for i in range(m):
    bridge[i]=list(map(int,input().split()))
ans=[0 for i in range(m+1)]
ans[0]=int((n-1)*n/2)
k=1
for i in reversed(bridge):
    ans[k]=ans[k-1]
    for j in range(i[0]):
        if i[0] in iland[j]:
            temp=j
            break
    for j in range(i[1]):
        if i[1] in iland[j]:
            if temp!=j:
                ans[k]=ans[k-1]-len(iland[j])*len(iland[temp])
                iland[temp].extend(iland[j])
                del iland[j]
                break
    if ans[k]==0:
        ans[k:]=[0 for l in range(m-k)]
        break
    k+=1
for i in range(m):
    print(ans[m-1-i])

### FIXED CODE ###

n,m=map(int,input().split())
bridge=[[] for i in range(m)]
leader=[i for i in range(n+1)]
member=[1 for i in range(n+1)]
for i in range(m):
    bridge[i]=list(map(int,input().split()))
ans=[0 for i in range(m+1)]
ans[0]=int((n-1)*n/2)
k=1
for i in reversed(bridge):
    le0=leader[i[0]]
    le1=leader[i[1]]
    while le0!=leader[le0]:
        le0=leader[le0]
        leader[i[0]]=le0
        
    while le1!=leader[le1]:
        le1=leader[le1]
        leader[i[1]]=le1
        
    if le0!=le1:
        ans[k]=ans[k-1]-member[le0]*member[le1]
        if member[le0]>=member[le1]:
            member[le0]+=member[le1]
            leader[le1]=le0
        else:
            member[le1]+=member[le0]
            leader[le0]=le1
    else:
        ans[k]=ans[k-1]
    if ans[k]==0:
        ans[k:]=[0 for l in range(m-k)]
        break
    k+=1
for i in range(m):
    print(ans[m-1-i])
A,B,C = list(map(int,input().split()))
list.sort()
print(list[2]-list[0])

### FIXED CODE ###

A = list(map(int,input().split()))
A.sort()
print(A[2]-A[0])
aa

### FIXED CODE ###

c=input()
print(chr(ord(c)+1))
# D
N, X = map(int, input().split())
lv = [0]*(N+1)
lv[0] = 'P'
for i in range(1, len(lv)):
    lv[i] = 'B' + lv[i-1] + 'P' + lv[i-1] + 'B'
print(lv[N][-X:].count('P'))

### FIXED CODE ###

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

a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(n, x):
    if n == 0:
        if x <= 0:
            return 0
        else:
            return 1
    elif x <= 1 + a[n - 1]:
        return f(n-1, x-1)
    else:
        return p[n-1] + 1 + f(n-1, x-2-a[n-1])

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

ans = 0
cnt = defaultdict(int)
for i in range(n):
	ans += cnt[i - a[i]]
	cnt[i + a[i]] += 1

print(ans)


### FIXED CODE ###

from collections import defaultdict

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

memo = defaultdict(int)
ans = 0
for i, a in enumerate(A, 1):
    ans += memo[i - a]
    memo[a + i] += 1

print(ans)
i = 1
while true:
  x = int(input())
  if x==0: break
  print('Case {}: {}'.format(i,x))
  i += 1


### FIXED CODE ###

i,x = 1,input()
while x != "0":
  print('Case '+str(i)+': '+x)
  i,x = i+1,input()
num = input()
list = list(map(int, inpit().split()))

def hoge(list):
  new_list = []
  for i in list:
    if i % 2 == 0:
      new_list.append(i)
    else:
      return False
  return new_list

count = 0
while True;
  list = hoge(list)
  if list == False:
    break
  count += 1

print(count)

### FIXED CODE ###

num = input()
listt = input().split()

def hoge(fuga):
    new_list = []
    for i in fuga:
        if int(i) % 2 == 0:
            new_list.append(int(i)/2)
        else:
            return False
    return new_list


count = 0
while True:
    listt = hoge(listt)
    if listt == False:
        break
    count += 1

print(count)
A,B,C,D,E,F = 10,11,12,13,14,15
x,y = map(int,input().split())
if x < y:
  print("<")
elif x > y:
  print(">")
else:
  print("=")

### FIXED CODE ###

A,B,C,D,E,F = 10,11,12,13,14,15
x,y = map(str,input().split())
if x < y:
  print("<")
elif x > y:
  print(">")
else:
  print("=")