Harryxun/stf_run huggingface dataset:
n,c=map(int,input().split())
d=[[] for i in range(c)]
w=[0]*100002
for i in range(n):
    s,t,x=map(int,input().split())
    d[x-1].append((s,t))

for i in range(c):
    d[i].sort()
    e=0
    for j in range(len(d[i])):
        if len(d[i])==1:
            w[d[i][0][0]]+=1
            w[d[i][0][1]+1]-=1
        elif j==0:
            w[d[i][0][0]]+=1
            e=d[i][0][1]
        elif j+1==len(d[i]):
            if e!=d[i][j][0]:
                w[e+1]-=1
                w[d[i][j][0]]+=1
            w[d[i][j][1]+1]-=1
        else:
            if e==d[i][j][0]:
                e=d[[i][j][1]]
            else:
                w[e+1]-=1
                w[d[i][j][0]]+=1
                e=d[i][j][1]
ans=chk=0
for i in w:
    chk+=i
    ans=max(ans,chk)
print(ans)

### FIXED CODE ###

n,c=map(int,input().split())
d=[[] for i in range(c)]
w=[0]*100002
for i in range(n):
    s,t,x=map(int,input().split())
    d[x-1].append((s,t))
for i in range(c):
    d[i].sort()
    e=0
    for j in range(len(d[i])):
        if len(d[i])==1:
            w[d[i][0][0]]+=1
            w[d[i][0][1]+1]-=1
        elif j==0:
            w[d[i][0][0]]+=1
            e=d[i][0][1]
        elif j+1==len(d[i]):
            if e!=d[i][j][0]:
                w[e+1]-=1
                w[d[i][j][0]]+=1
            w[d[i][j][1]+1]-=1
        else:
            if e!=d[i][j][0]:
                w[e+1]-=1
                w[d[i][j][0]]+=1
            e=d[i][j][1]
ans=chk=0
for i in w:
    chk+=i
    ans=max(ans,chk)
print(ans)
C:\Users\satosyuuta\Anaconda3\python.exe C:/Users/satosyuuta/PycharmProjects/untitled/xtb/AtCorder/test.py
0
1

Process finished with exit code 0


### FIXED CODE ###

N = int(input())
if N == 1:
    print(int(0))
else:
    print(int(1))
def get_difference():
	# get input from raw_input()
	n, k = map(int, raw_input().split(' '))
	l = [int(e) for e in raw_input().split(' ')]
	if k in l:
		print "POSSIBLE"
		return
	if k>max(l):
		print "INPOSSIBLE"
		return
	gcd_v = reduce(gcd, l)
	if k%gcd_v==0:
		print "POSSIBLE"
	else:
		print "INPOSSIBLE"


if __name__ == "__main__":
	get_difference()

### FIXED CODE ###

from fractions import gcd
N, K = map(int, raw_input().split(' '))
A = map(int, raw_input().split(' '))
 
M = max(A)
G = reduce(gcd, sorted(A))
 
if not K % G and K <= M:
    print 'POSSIBLE'
else:
    print 'IMPOSSIBLE'
N = int(input())

A = list(map(int,input().split()))
ok = [0]*pow(10,5)
Q = int(input())

li = [list(map(int,input().split())) for i in range(Q)]

for i in range(N):
    ok[A[i]]+=1
memo=0

S = sum(A)
for i in range(Q):
    print(S + ok[li[i][0]]*(li[i][1]-li[i][0]))
    a = ok[li[i][0]]
    ok[li[i][1]]+=a
    ok[li[i][0]]=0

### FIXED CODE ###

N = int(input())


A = list(map(int,input().split()))
ok = [0]*pow(10,6)
Q = int(input())

li = [list(map(int,input().split())) for i in range(Q)]

for i in range(N):
    ok[A[i]]+=1
memo1=0
memo2=0

S = sum(A)
for i in range(Q):

    S+=ok[li[i][0]]*(li[i][1]-li[i][0])
    print(S)
    a = ok[li[i][0]]
    ok[li[i][1]]+=a
    ok[li[i][0]]=0
from numpy import*
M=10**9+7
f=lambda*s:[*map(int,input().split())]
n,k=f()
a=matrix([*map(f,[0]*n)])
b=eye(n,dtype=int)
while k:
 if k&1:b=b*a%M
 a=a*a%M;k>>=1
print(sum(b)%M)

### FIXED CODE ###

from numpy import*
M=10**9+7
m=lambda:map(int,input().split())
n,k=m()
a=matrix([list(m())for i in[0]*n],'O')
b=eye(n,n,0,'O')
while k:b=[b,b*a][k&1];a=a*a%M;k>>=1
print(sum(b)%M)
x,y,z = input.split()
if (x/y <= z)
	print("Yes")
elif
	print("No")

### FIXED CODE ###

x,y,z = input().split()
if ( int(x) / int(y) <= int(z)):
	print("Yes")
else:
	print("No")
import heapq

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

from operator import mul
from functools import reduce

def cmb(n, r):
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

heapq.heapify(A)

cmb_list = {}
cmb_list[(K - 1, K - 1)] = cmb(K - 1, K - 1)
cmb_val = cmb(K - 1, K - 1)
for i in range(K, N):
    cmb_val = cmb_val * i / (i - (K - 1))
    cmb_list[(i, K-1)] = int(cmb_val)
# print(cmb_list)

# print(A)

max_f = 0
min_f = 0


for idx in range(N):
    a = heapq.heappop(A)
    if idx >= K-1:
        max_f += cmb_list[(idx, K-1)]*a
        # print("max", cmb(idx, K-1), idx, K-1, a)

    if N-(idx+1) >= K - 1:
        min_f += cmb_list[(N-(idx+1), K-1)]*a
        # print("min", cmb(N-(idx+1), K-1), N-(idx+1), K-1, a)

print((max_f - min_f) % (10**9+7))

### FIXED CODE ###

import heapq

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

from operator import mul
from functools import reduce

MOD = 10 ** 9 + 7

def mpow(a, n):
    if n == 0: return 1
    if n == 1: return a % MOD
    if n % 2 == 1: return (a % MOD * mpow(a, n - 1) % MOD) % MOD
    t = mpow(a, n // 2)
    return (t * t) % MOD

fac = [1] * (n + 1)
inv_fac = [1] * (n + 1)
for i in range(n):
    fac[i + 1] = (fac[i] * (i + 1)) % MOD
inv_fac[n] = mpow(fac[n], MOD - 2)
for i in range(n, 0, -1):
    inv_fac[i - 1] = (inv_fac[i] * i) % MOD

def cmb(n, r):
    if n == 0 and r == 0: return 1
    if n < r or n < 0: return 0
    return (fac[n] * (inv_fac[r] * inv_fac[n - r]) % MOD) % MOD

A.sort()

# cmb_list = {}
# cmb_list[(K - 1, K - 1)] = cmb(K - 1, K - 1)
# for i in range(K, n):
#     cmb_list[(i, K-1)] = cmb_list[(i-1, K-1)] * i // (i - (K - 1))

max_f = 0
min_f = 0

for idx in range(n):
    a = heapq.heappop(A)
    if idx >= K - 1:
        max_f += cmb(idx, K - 1) * a
        # print("max", cmb(idx, K-1), idx, K-1, a)

    if n - (idx + 1) >= K - 1:
        min_f += cmb(n - (idx + 1), K - 1) * a
        # print("min", cmb(N-(idx+1), K-1), N-(idx+1), K-1, a)

print((max_f - min_f) % (10**9+7))
import math
N = (int(input()))
items = list(map(int,input().split()))
for i in range(len(items)):    
    rest = items[:i] + items[i+1:]
    rest_unique = sorted(set(rest))
    out = 0
    for j in rest_unique:
        cnt = sum([1 for x in rest if x == j])
        if cnt >= 2:
            out = out + math.factorial(cnt)/math.factorial(cnt-2)/2
    print(int(out))

### FIXED CODE ###

import math
e,o = map(int,input().split())
if e < 2:
    e_cases = 0
else:
    e_cases = math.factorial(e)/math.factorial(e-2)/2
if o < 2:
    o_cases = 0
else:
    o_cases = math.factorial(o)/math.factorial(o-2)/2
print(int(e_cases+o_cases))
import sys
N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
t = sum(S)
if t % 10 != 0:
    print(t)
    sys.exit()

for s in range(S):
    if (t - s) % 10 != 0:
        print(t - s)
        sys.exit()
print(0)


### FIXED CODE ###

import sys
N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
t = sum(S)
if t % 10 != 0:
    print(t)
    sys.exit()

for s in S:
    if (t - s) % 10 != 0:
        print(t - s)
        sys.exit()
print(0)
M1,D1=map(int,input().split())
M2,D2=map(int,input().split())

if d2==1:
  print 1
else:
  print 0


### FIXED CODE ###

M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if D2 == 1:
    print(1)
else:
    print(0)
n = int(input())
A = list(map(int, input().split()))
ans = 1
p = 0
if 0 in A:
  p -= 1
else:
  for i in range(n):
  	ans *= A[i]
  	if ans >= 10**(18):
    	p += 1
    	break
if p == 0:
  print(ans)
elif p == -1:
  print(0)
else:
  print(-1)

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = 1
A = sorted(A)
for i in range(n):
  ans *= A[i]
  if ans > 10**(18):
    print('-1')
    exit()
print(ans)
import sys
input = sys.stdin.readline

def main():
    n = input()
    a =ord(n)
    if a>96:
        print("a")
    else:
        print("A")

if __name__ == "__main__":
    main()


### FIXED CODE ###


n = input()
a =ord(n)
if a>96:
    print("a")
else:
    print("A")
import heapq

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
ABS = sorted(AB, key=lambda x: -x[1])
ABSS = sorted(ABS, key=lambda x: x[0])
# print(ABS)
# print(ABSS)

heap = []
ans = 0
chkpos = 0

for i in range(1, M+1):
  while ABSS[chkpos][0] <= i:
    heapq.heappush(heap, -1 * ABSS[chkpos][1])
    chkpos += 1
    if chkpos >= N -1:
      break
#  print(heap)
  if len(heap) > 0:
    ans -= heapq.heappop(heap)
print(ans)

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
ABS = sorted(AB, key=lambda x: -x[1])
ABSS = sorted(ABS, key=lambda x: x[0])
# print(ABS)
# print(ABSS)

heap = []
ans = 0
chkpos = 0

for i in range(1, M + 1):
  if chkpos < N:
    while ABSS[chkpos][0] <= i:
  #    print(chkpos, len(ABSS))
      heapq.heappush(heap, -1 * ABSS[chkpos][1])
      chkpos += 1
      if chkpos >= N:
        break
  #  print(heap)
    if len(heap) > 0:
      ans -= heapq.heappop(heap)
  else:
    ans -= heapq.heappop(heap)
print(ans)
N, K, C = map(int, input().split())
S = list(input())
S_work = []
for i in range(N):
  if S[i] == "o":
    S_work.append(i)
start_worklist = []
final_worklist = []
bef = [-2 * 10 ** 5, 2 * 10 ** 5]

for num1 in S_work:
  if num1 - bef[0] > C:
    start_worklist.append(num1)
    bef[0] = num1
  elif len(start_worklist) == K:
    break  

S_work.sort(reverse=True)
for num2 in S_work:
  if bef[1] - num2 > C:
    final_worklist.insert(0, num2)
    bef[1] = num2
  elif len(final_worklist) == K:
    break
for i in range(K):
  if start_worklist[i] == final_worklist[i]:
    print(start_worklist[i] + 1)



### FIXED CODE ###

N, K, C = map(int, input().split())
S = list(input())
S_work = []
s = []
f = []
i = 0
while len(s) < K:
  if S[i] == "o":
    s.append(i)
    i += C + 1
  elif S[i] == "x":
    i += 1
  elif i == len(S):
    break
i = 1
while len(f) < K:
  if S[N - i] == "o":
    f.append(N - i)
    i += C + 1
  elif S[N - i] == "x":
    i += 1
  elif i == len(S):
    break
f.sort()
for i in range(K):
  if s[i] == f[i]:
    print(s[i] + 1)
s=input()
n=int(s)
m=0
for i in s:
    m+=i
if n%m==0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s=input()
n=int(s)
m=0
for i in s:
    m+=int(i)
if n%m==0:
    print("Yes")
else:
    print("No")
N,X = map(int,input().split())
l=[0]
l.append(list(map(int,input().split())))

sum=0
for i in range(N+1):
    sum += l[i]
    if sum>X:
        print(i)
        exit()
print(N+1)

### FIXED CODE ###

N,X = map(int,input().split())
l=[0]
l += list(map(int,input().split()))
sum=0
for i in range(N+1):
    sum += l[i]
    if sum>X:
        print(i)
        exit()
print(N+1)
n = int(input())
a = [input() for i in range(n)]
margin = max(a) - min(a)
print(margin)


### FIXED CODE ###

n = int(input())
R = [int(input()) for i in range(n)]

minv = R[0]
maxv = R[1] - R[0]
for j in range(1, n):
	if (maxv < R[j] - minv):
		maxv = R[j] - minv
	if (R[j] < minv):
		minv = R[j]
    
print(maxv)
n = int(input())
s = []
for i in range(n):
  tmp = str(input())
  tmp.sort()
  s.append(tmp)

a = [0 for i in range(10**3)]
for i in range(2, 10**3):
  x = a[i-1] + (i-1)
  a[i] = x

ans = 0
for _ in list(set(s)):
  ans+= a[s.count(_)]
  
print(ans)

### FIXED CODE ###

alphabet = "abcdefghijklmnopqrstuvwxyz"


n = int(input())
res = dict()
for _ in range(n):
    s = str(input())
    freqency = [0 for _ in alphabet]
    for __ in s:
        freqency[alphabet.index(__)] += 1
    freq = "".join([str(___) for ___ in freqency])
    if freq not in res:
        res[freq] = 1
    else:
        res[freq] += 1

ans = 0
for value in res.values():
    ans += ((value-1)*value)/2
  
print(int(ans))
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def is_tasai(S):
    appare_set = set([])
    for s in S:
        if s in appare_set:
            return False
        appare_set.add(s)
    return True

table = {}
def comb(n, r):
    if (n, r) in table:
        return table[(n, r)]
    if n == r:
        table[(n, r)] = 1L
        return 1L
    if r == 0:
        table[(n, r)] = 1L
        return 1L
    if n == 0:
        return 0L
    table[(n, r)] = comb(n-1, r-1)+ comb(n-1, r)
    return table[(n, r)]


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    initial_dict = {}
    initial_dict["M"] = 0
    initial_dict["A"] = 0
    initial_dict["R"] = 0
    initial_dict["C"] = 0
    initial_dict["H"] = 0

    for i in range(N):
        input_raw = read_func().strip().split()
        if input_raw[0][0] in initial_dict:
            initial_dict[input_raw[0][0]] += 1
    M = 0
    for s in initial_dict:
        M += initial_dict[s]
    remove_num = 0
    for s in initial_dict:
        remove_num += comb(initial_dict[s], 2) * (M - 2)
    print comb(M, 3) - remove_num



if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def is_tasai(S):
    appare_set = set([])
    for s in S:
        if s in appare_set:
            return False
        appare_set.add(s)
    return True

table = {}
def comb(n, r):
    a = 1L
    b = 1L
    for i in range(r):
        a *= n - i
        b *= r - i
    return a/b

##    if (n, r) in table:
##        return table[(n, r)]
##    if n == r:
##        table[(n, r)] = 1L
##        return 1L
##    if r == 0:
##        table[(n, r)] = 1L
##        return 1L
##    if n == 0:
##        return 0L
##    table[(n, r)] = comb(n-1, r-1)+ comb(n-1, r)
##    return table[(n, r)]


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    initial_dict = {}
    initial_dict["M"] = 0
    initial_dict["A"] = 0
    initial_dict["R"] = 0
    initial_dict["C"] = 0
    initial_dict["H"] = 0

    for i in range(N):
        input_raw = read_func().strip().split()
        if input_raw[0][0] in initial_dict:
            initial_dict[input_raw[0][0]] += 1
    M = 0
    for s in initial_dict:
        M += initial_dict[s]
    remove_num = 0L
    for s in initial_dict:
        remove_num += comb(initial_dict[s], 2) * (M - initial_dict[s])
        remove_num += comb(initial_dict[s], 3)
    print comb(M, 3) - remove_num


if __name__ == '__main__':
    main()
N,X=map(int,input().split())
x=list(map(int,input().split()))+[X]

from math import gcd

x=[x[i+1]-x[i] for i in range(N)]

ans=0
for i in range(N):
    ans=gcd(ans,x[i])
print(abs(ans))

### FIXED CODE ###

N,X=map(int,input().split())
x=list(map(int,input().split()))+[X]

from fractions import gcd

x=[x[i+1]-x[i] for i in range(N)]

ans=0
for i in range(N):
    ans=gcd(ans,x[i])
print(abs(ans))
#たのん
s=input()
q=int(input())
head=[]
tail=[]
rev=False
for _ in range(q):
  tmp=list(input().split())
  if tmp[0]=='1': #文字列を反転させる操作のとき
    if rev==False: #反転していない状態であれば反転した状態にする
      rev=True
    else:
      rev=False #反転した状態であれば反転していない状態にする
  if tmp[0]=='2': #文字を追加する操作のとき
    if rev==False: 
     #反転していない状態であれば、先頭への追加はそのまま先頭に、末尾への追加もそのまま末尾に追加する
      if tmp[1]=='1':
        head.append(tmp[2])
      if tmp[1]=='2':#単純にelseとしてもOKだが、略さない方が間違えない
        tail.append(tmp[2])#↓Trueの場合、if revでOKだが、略さないがベター
  if rev==True:#反転した状態であれば、先頭への追加は末尾への追加に、末尾への追加は先頭への追加に置き換える
    if tmp[1]=='1':
      tail.append(tmp[2])
    if tmp[1]=='2':
      head.append(tmp[2])
head=''.join(map(str,head))#文字列として結合しておく
tail=''.join(map(str,tail))
ans=head[::-1]+s+tail #答えは(先頭に追加した文字列の逆順)+(元の文字列)+(末尾に追加した文字列)となる
if rev==True: #もし最終的に文字列が反転した状態なら答えの文字列を反転させる
  ans=ans[::-1]
print(ans)

### FIXED CODE ###

import collections

s = collections.deque(list(input()))
q = int(input())
rev = 0
for i in range(q):
    tfc = list(input().split())
    if tfc[0]=='1':
        rev = abs(rev-1)
    else:
        t,f,c = tfc
        if rev:
            if f=='1':
                s.append(c)
            else:
                s.appendleft(c)
        else:
            if f=='1':
                s.appendleft(c)
            else:
                s.append(c)
if rev:
    t = []
    for i in range(len(s)):
        t.append(s.pop())
    print(''.join(t))
else:
    print(''.join(s))
'''
初期文字列 s が与えられ q 個のクエリを処理した後の文字列を求めます。
10^100回繰り返す根気があるなら自分でやってくれと思わなくもないです。
さて、各クエリではまず t が与えられます。t=1の時文字列を反転させます。
t=2の時はさらに f,c が与えられ、f=1の時文字列の先頭にcを加えます。
f=2の時文字列の末尾にcを加えます。
愚直に行おうとすると文字列の反転で O(len(s))、先頭への追加で 
O(len(s)) かかってしまい間に合いません。
そこでcollections.dequeを利用します。先頭、末尾への追加をO(1) で行えます。
注意する点は反転させると追加する位置が逆になることです。
なので現在の状態を管理しておく必要があります。
同様に出力する時も最終的な向きによって出力する順番が逆になります。
'''
n,d = map(int,input().split())
a = list([input() for i in range(0,d)] for j in range(0,n))
c = 0
r = 0
for i in range(0,n):
  for j in range(i+1,n):
    for k in range(0,d):
      c += (a[i][k]-a[j][k])^2
ans = c^(1/2)
if isinstance(ans,int) == True:
  r += 1
print(r)

### FIXED CODE ###

import math
n,d = map(int,input().split())
x = [list(map(int, input().split())) for i in range(n)]
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        t = 0
        for k in range(d):
            t+=(x[i][k]-x[j][k])**2 
        if math.sqrt(t)==int(math.sqrt(t)):
            ans += 1
print(ans)
x, n = map(int, input().split())
p = list(map(int, input().split()))
a = 0
ans = ''
p.sort()
print(p)
while ans == '':
  if len(p) == 0:
    ans = x
  elif x - a not in p:
    ans = x - a
  elif x + a not in p:
    ans = x + a
  else:
    a += 1
print(ans)

### FIXED CODE ###

l = list(map(int, input().split()))
print(l.index(0) + 1)
data = ["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"]

print(data(int(input())-22))

### FIXED CODE ###

data = ["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"]

print(data[int(input())-22])
A, B =map(int, input().split())
print(max((A-1)*(B-1)))

### FIXED CODE ###

A, B =map(int, input().split())
print(((A-1)*(B-1)))
from math import *

def main():
    m, n = [int(_) for _ in input().split()]
    print(int(pow(m, n) % 1000000007))

main()



### FIXED CODE ###

def main():
    m, n = [int(_) for _ in input().split()]
    print(pow(m, n, 1000000007))

main()
s = input()
if s == "Sunny":
    print("Cloudy")
elif:
    print("Rainy")
else:
    print("Sunny")  

### FIXED CODE ###

S = input()
if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
import fraction 
X,Y = map(int, input().split())
def lcm(x, y):
    return (x * y) // fraction.gcd(x, y)
print(lcm(X,Y))

### FIXED CODE ###

import fractions
X,Y = map(int, input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
print(lcm(X,Y))
n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(N+1)
 
for i in range(n):
    if S[i:i+2] == 'AC':
        comu[i+1] = comu[i] + 1
    else:
        comu[i+1] = comu[i]
 
for l,r in m:
    print(count[r-1]-count[l-1])

### FIXED CODE ###

n,q = map(int,input().split())
s = input()
m = [list(map(int,input().split())) for i in range(q)]
count = [0]*(n+1)
 
for i in range(n):
    if s[i:i+2] == 'AC':
        count[i+1] = count[i] + 1
    else:
        count[i+1] = count[i]
 
for l,r in m:
    print(count[r-1]-count[l-1])
from fractions import gcd
N=int(input())
A=list(map(int,input().split()))
print(A)

L=[0]*N
R=[0]*N
L[0]=A[0]
R[0]=A[N-1]

for n in range(1,N):
  L[n]=gcd(A[n],L[n-1])
  R[n]=gcd(A[N-n-1],R[n-1])
  
  ans=max(L[N-2],R[N-2])

for i in range(1,N-1):
  ans=max(ans,gcd(L[i-1],R[N-i-2]))

print(ans)

### FIXED CODE ###

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

print(int((T+0.5)//A*B))
N,K=map(int,input().split())
import math
s=0
for j in range(1,N+1):
  if (K/j)%2==0:
    s+=log2(K//j)
  else:
    s+=int(log2(K/j))+1
print(float(N/(s+N)))
    

### FIXED CODE ###

N,K=map(int,input().split())
i=0
q=0 #確率
for j in range(1,N+1):
  while j*(2**i)<K:
    i+=1
  q+=(1/N)*((1/2)**i)
  i=0
print(q)
S = list(input())
print(S.count("+")-S.count("-")


### FIXED CODE ###

S = list(input())
print(S.count("+")-S.count("-"))
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count=0
for a in [a*500 for a in range(A + 1)]:
    for b in [b*100 for b in range(B + 1)]:
        for c in [c*50 in range(C + 1)]:
            if a + b + c == X:
                count += 1
print(count)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
res=0
for  i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if 500*i + 100*j + 50*k == X:
                res += 1
print(res)
B = [int(input()) for _ in range(5)]
A = [str(B[i])[-1] for i in range(5)]
temp = A
last = A.index(min(temp.remove("0")))
diff = [10-int(A[o]) for o in range(5) if (A[o] != "0") and o != last]
print(sum(B)+sum(diff))


### FIXED CODE ###

B = [int(input()) for _ in range(5)]
A = [10-int(str(B[i])[-1]) for i in range(5) if str(B[i])[-1] != "0"]
if len(A) != 0:
	A.remove(max(A))
print(sum(B)+sum(A))
a, b = map(int, input().split())
s = list(range(a, b+1))
if 0 in s:
  print("Zero")
else:
  c = 0
  for i in s:
    if i < 0:
      c += 1
  if c % 2 == 0:
    print("Positive")
  else:
    print("Negative")

### FIXED CODE ###

a, b = map(int, input().split())
if a <= 0 <= b:
  print("Zero")
elif a > 0:
  print("Positive")
else:
  if (b - a + 1) % 2 == 0:
    print("Positive")
  else:
    print("Negative")
y = [31,29,31,30,31,30,31,31,30,31,30,31]
dow = [0:"Monday", 1:"Thuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday", 5:"Saturday", 6:"Sunday"]

while True:
    m, d = map(int, raw_inpud().split())
    if m == 0 and d == 0:
        break
    n =	0
    for i in range(m):
        n += y[i]
    n -= (n[m]-d+1)
    print dow[(n+3)%7]

### FIXED CODE ###

y = [31,29,31,30,31,30,31,31,30,31,30,31]
dow = {0:"Monday", 1:"Tuesday", 2:"Wednesday", 3:"Thursday", 4:"Friday", 5:"Saturday", 6:"Sunday"}

while True:
    m, d = map(int, raw_input().split())
    if m == 0 and d == 0:
        break
    n = 0
    for i in range(m):
        n += y[i]
    n -= (y[m-1]-d+1)
    print dow[(n+3)%7]
N, M = map(int, input().split())
height = [int(i) for i in input().split()]
roads = [list(map(int, input().split())) for _ in range(N)]
alone=[]
ans={}
b_list=[]
for i in range(1, N+1):
  alone.append(i)
for road in roads:
  if max(road) not in b_list:
    ans[max(road)]='Yes'
    b_list.append(min(road))
  elif road[0] in alone:
    alone.remove(road[0])
  elif road[1] in alone:
    alone.remove(road[1])
print(len(ans)+len(alone))

### FIXED CODE ###

N, M = map(int, input().split())
height = [int(i) for i in input().split()]
Good_Peak = []
for i in range(N):
  Good_Peak.append(True)
for i in range(M):
  A, B = map(int, input().split())
  if height[A-1] <= height[B-1]:
    Good_Peak[A-1] = False
  if height[B-1] <= height[A-1]:
    Good_Peak[B-1] = False
print(Good_Peak.count(True))
n = int(input())
tree = [[] for _ in range(n)]
color = [0]*n
for _ in range(n-1):
  a,b,c = map(int,input().split())
  a -= 1
  b -= 1
  tree[a].append((b,c))
  tree[b].append((a,c))
  
  
def dfs(i,before,cost):
  if cost == 1:
    color[i] = 1
  for j in tree[i]:
    if j[0] == before:
      continue
    dfs(j[0],i,(cost + j[1])%2 )
    
dfs(0,-1,0)

for i in range(n):
  print(color[i])
  



### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n = int(input())
tree = [[] for _ in range(n)]
color = [0]*n
for _ in range(n-1):
  a,b,c = map(int,input().split())
  a -= 1
  b -= 1
  tree[a].append((b,c))
  tree[b].append((a,c))
  
  
def dfs(i,before,cost):
  if cost == 1:
    color[i] = 1
  for j in tree[i]:
    if j[0] == before:
      continue
    dfs(j[0],i,(cost + j[1])%2 )
    
dfs(0,-1,0)

for i in range(n):
  print(color[i])
n = int(input())
a,b = [],[]
for i in range(n):
    ta,tb = map(int, input().split())
    a.append(ta)
    b.append(tb)
mai = a[b.index(max(b))]
mii = a[index(min(b))]
print(mii+(min(b))+mai-1)


### FIXED CODE ###

n = int(input())
a,b = [],[]
for i in range(n):
    ta,tb = map(int, input().split())
    a.append(ta)
    b.append(tb)
mii = a[b.index(min(b))]
print(mii+(min(b)))