Harryxun/stf_run huggingface dataset:
def main(N, X):
    lst = list(map(int, list(X)))
    num = lst.count(1)  # 初期状態で1を持つ数．

    def func(x):    # xは10進数
        lst = list(bin(x)[2:])
        amari =  x % lst.count('1')
        return amari

    d = {}
    for i in range(1, num + 2):
        d[i] = func(i)


    # 反転させるので num + 1 か， num - 1 で割る場合しか存在しない．
    plus = []   # num + 1 で各桁 (2 ** n) を割った値を保存
    minus = []  # num - 1 で各桁 (2 ** n) を割った値を保存

    p = 1
    m = 1
    for n in range(N):
        p %= (num + 1)
        plus.append(p)
        m %= (num - 1)
        minus.append(m)
        p *= 2
        m *= 2

    o = int(X, 2)   # originalの 'o'
    amari_plus = o % (num + 1)
    amari_minus = o % (num - 1)

    for i in range(N):
        if lst[i] == 0:
            amari = (amari_plus + plus[N - i - 1]) % (num + 1)
        else:
            amari = (amari_minus + num - 1 - minus[N - i - 1]) % (num - 1)
        ans = 1
        while amari != 0:
            amari = d[amari]
            ans += 1
        print(ans)




if __name__ == '__main__':
    N = int(input())
    X = input()

    # N = 2 * 10 ** 5
    # import numpy as np
    # X = ''.join([str(int(round(i))) for i in np.random.rand(N)])

    # N = 3
    # X = '011'

    # import time
    # t1 = time.time()
    main(N, X)

### FIXED CODE ###

def main(N, X):
    lst = list(map(int, list(X)))
    num = lst.count(1)  # 初期状態で1を持つ数．

    def func(x):    # xは10進数
        lst = list(bin(x)[2:])
        amari =  x % lst.count('1')
        return amari

    d = {}
    for i in range(1, N):
        d[i] = func(i)


    # 反転させるので num + 1 か， num - 1 で割る場合しか存在しない．
    plus = []   # num + 1 で各桁 (2 ** n) を割った値を保存
    minus = []  # num - 1 で各桁 (2 ** n) を割った値を保存

    p = 1
    m = 1
    for n in range(N):
        p %= (num + 1)
        plus.append(p)
        p *= 2
        if num - 1 > 0:
            m %= (num - 1)
            minus.append(m)
            m *= 2

    o = int(X, 2)   # originalの 'o'
    amari_plus = o % (num + 1)
    if num - 1 > 0:
        amari_minus = o % (num - 1)

    for i in range(N):
        if lst[i] == 0:
            amari = (amari_plus + plus[- i - 1]) % (num + 1)
        elif num - 1 <= 0:
            print(0)
            continue
        else:
            amari = (amari_minus + (num - 1) - minus[- i - 1]) % (num - 1)
        ans = 1
        while amari != 0:
            amari = d[amari]
            ans += 1
        print(ans)

if __name__ == '__main__':
    N = int(input())
    X = input()
    main(N, X)
n = int(input())
a = list(map(int,input().split()))

a.sort()

u,d,z = 0,0,0
uu,dd = [],[]
for i in range(n):
    if a[i] > 0:
        u += 1
        uu.append(a[i])
    elif a[i] < 0:
        d += 1
        dd.append(a[i])
    else:
        z += 1
        
dd = dd[::-1]
        
ans = []
if u == 0 and d == 0:
    for i in range(z):
        ans.append((0,0))
    cur = 0
    
elif d == 0:
    if z != 0:
        for i in range(z-1):
            ans.append((0,0))
        cur = 0
        for i in range(u-1):
            ans.append((cur,uu[i]))
            cur -= uu[i]
        ans.append((uu[u-1],cur))
        cur = uu[u-1] - cur
    else:
        cur = uu[0]
        for i in range(u-2):
            ans.append((cur,uu[i+1]))
            cur -= uu[i+1]
        ans.append((uu[u-1],cur))
        cur = uu[u-1] - cur
        
elif u == 0:
    if z != 0:
        for i in range(z-1):
            ans.append((0,0))
        cur = 0
        for i in range(d):
            ans.append((cur,dd[i]))
            cur -= dd[i]
    
    else:
        dd = d[::-1]
        cur = dd[0]
        for i in range(u-1):
            ans.append((cur,uu[i+1]))
            cur -= uu[i+1]
            
else:
    for i in range(z):
        ans.append((uu[0],0))
    cur1 = uu[0]
    cur2 = dd[0]
    for i in range(d-1):
        ans.append((cur1,dd[i+1]))
        cur1 -= dd[i+1]
    for i in range(u-1):
        ans.append((cur2,uu[i+1]))
        cur2 -= uu[i+1]
        
    ans.append((cur1,cur2))
    cur = cur1 - cur2
    
print(cur)
for i in ans:
    print(*i)

### FIXED CODE ###

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

a.sort()

u,d,z = 0,0,0
uu,dd = [],[]
for i in range(n):
    if a[i] > 0:
        u += 1
        uu.append(a[i])
    elif a[i] < 0:
        d += 1
        dd.append(a[i])
    else:
        z += 1
        
dd = dd[::-1]
        
ans = []
if u == 0 and d == 0:
    for i in range(z-1):
        ans.append((0,0))
    cur = 0
    
elif d == 0:
    if z != 0:
        for i in range(z-1):
            ans.append((0,0))
        cur = 0
        for i in range(u-1):
            ans.append((cur,uu[i]))
            cur -= uu[i]
        ans.append((uu[u-1],cur))
        cur = uu[u-1] - cur
    else:
        cur = uu[0]
        for i in range(u-2):
            ans.append((cur,uu[i+1]))
            cur -= uu[i+1]
        ans.append((uu[u-1],cur))
        cur = uu[u-1] - cur
        
elif u == 0:
    if z != 0:
        for i in range(z-1):
            ans.append((0,0))
        cur = 0
        for i in range(d):
            ans.append((cur,dd[i]))
            cur -= dd[i]
    
    else:
        cur = dd[0]
        for i in range(d-1):
            ans.append((cur,dd[i+1]))
            cur -= dd[i+1]
            
else:
    for i in range(z):
        ans.append((uu[0],0))
    cur1 = uu[0]
    cur2 = dd[0]
    for i in range(d-1):
        ans.append((cur1,dd[i+1]))
        cur1 -= dd[i+1]
    for i in range(u-1):
        ans.append((cur2,uu[i+1]))
        cur2 -= uu[i+1]
        
    ans.append((cur1,cur2))
    cur = cur1 - cur2
    
print(cur)
for i in ans:
    print(*i)
def main():
    S = input()
    K = int(input())
    ans = 0

    if S[0] is S[-1]:
        length = len(S)
    else:
        length = len(S) - 1

    i = 0
    while i < length:
        if S[i] is S[i + 1]:
            ans += 1
            i += 1
        i += 1

    print(ans * K)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    S = input()
    K = int(input())
    ans = 0

    if len(set(S)) is 1:
        print(len(S) * K // 2)
        return

    i = 0
    cnt = [1]
    while i < len(S) - 1:
        if S[i] is S[i + 1]:
            cnt[-1] += 1
        else:
            cnt.append(1)
        i += 1

    for v in cnt:
        ans += (v // 2) * K

    if S[0] is S[-1]:
        if cnt[0] % 2 == cnt[-1] % 2 == 1:
            ans += K - 1

    print(ans)


if __name__ == "__main__":
    main()
x=[]
n=int(input())
for i in range(0,n):
    xa=int(input())
    x.append(xa)
count=0
for i in range(0,n-2):
    for j in range(i,n-1):
        if(x[i]==x[j]):
            continue
        for k in range(j,n):
            if((x[i]==x[k])or(x[j]==x[k])):
               continue
            if ((x[i]+x[j]>x[k])or(x[i]+x[k]>x[j])or(x[j]+x[k]>x[i])):
                count+=1
print(count)

### FIXED CODE ###

n = int(input().strip())
x = list(map(int, input().strip().split()))
count=0
for i in range(0,n-2):
    for j in range(i,n-1):
        if(x[i]==x[j]):
            continue
        for k in range(j,n):
            if((x[i]==x[k])or(x[j]==x[k])):
                continue
            if ((x[i]+x[j]>x[k])and(x[i]+x[k]>x[j])and(x[j]+x[k]>x[i])):
                count+=1
print(count)
s,w=[int(x) for x in input().split()]
if w>=n:
  print('unsafe')
else:print('safe')

### FIXED CODE ###

s,w=[int(x) for x in input().split()]
if w>=s:print('unsafe')
else:print('safe')
if __name__ == '__main__':
    T = [int(input()) for _ in range(5)]
    
    del_max = -1
    idx_max = None
    for i in range(5):
        if T[i]%10 == 0:
            pass
        elif 10 - T[i]%10 > del_max:
            del_max = 10 - T[i]%10
            idx_max = i
    
    count = 0
    for i in range(5):
        if i != idx_max:
            time = (T[i]//10)*10
            if time < T[i]:
                time += 10
            count += time
    count += T[idx_max]
    
    print(count)

### FIXED CODE ###

if __name__ == '__main__':
    T = [int(input()) for _ in range(5)]
    
    del_max = -1
    idx_max = 0
    for i in range(5):
        if T[i]%10 == 0:
            pass
        elif 10 - T[i]%10 > del_max:
            del_max = 10 - T[i]%10
            idx_max = i
    
    count = 0
    for i in range(5):
        if i != idx_max:
            time = (T[i]//10)*10
            if time < T[i]:
                time += 10
            count += time
    count += T[idx_max]
    
    print(count)
N = input()
n = list(map(int,raw_input().split()))

for i in range(1,int(N)):
    v = n[i]
    j = i - 1
    while j >= 0 and v < n[j]:
        n[j+1] = n[j]
        j = j - 1
    n[j+1] = v
    print(n.replace("[","").replace(",","").replace("]","")))

### FIXED CODE ###

def insertsort(array):
    for i in range(1,len(array)):
        print(" ".join(list(map(str,array))))
        temp = array[i]
        j = i-1
        while j >= 0 and temp < array[j]:
            array[j+1] = array[j]
            j -= 1
        array[j+1] = temp
    return array

input()
a = insertsort(list(map(int,input().split())))
print(" ".join(list(map(str,a))))
hoge

### FIXED CODE ###

#!/usr/bin/env python3
import sys
try: from typing import Any, Union, List, Tuple, Dict
except ImportError: pass
def debug(*args): print(*args, file=sys.stderr)
def exit(): sys.exit(0)


s = input()
K = int(input())
n = len(s)


def code(s):
    return ord(s)-97

def char(c):
    c = c % 26
    return chr(c+97)


# ans = ""
ans_list = []
for p in range(n):
    c = code(s[p])
    if c == 0:
        # ans += "a"
        ans_list.append("a")
        continue
    if 26-c > K:
        # ans += s[p]
        ans_list.append(s[p])
        continue
    # ans += "a"
    ans_list.append("a")
    K -= 26-c
ans = "".join(ans_list)
ans = ans[:-1] + char(code(ans[-1])+K)

print(ans)
n=int(input())
dat=list(map(int, input().split()))
      
re = 0
flag=True
while (flag==True):
        for e in dat:
               e=e/2
         re = re+1
         break
print(re)

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
# coding:utf-8
def main():
    n = int(input())
    h = list(map(int, input().split()))
    start_num = 0
    best_score = 1000
    best_sc = 0

    min_h = h.index(min(h))

    for i in range(n-1):
        score =  h[i] - h[i+1]
        if best_score >= score and score >= 0:
            if best_score == score:
                if h[i] > h[start_num]:
                    start_num = i
                    sc = 0
                    while  i != n - 1 and h[i] >= h[i+1] :
                        sc = sc + 1
                        i = i + 1
                    if best_sc <= sc:
                        best_sc = sc
                        best_score = score
            else:
                start_num = i
                sc = 0
                while  i != n - 1 and h[i] >= h[i+1] :
                    sc = sc + 1
                    i = i + 1
                    if best_sc <= sc:
                        best_sc = sc
                        best_score = score

    print(best_sc)





if __name__ == '__main__' :
    main()


### FIXED CODE ###

# coding:utf-8
def main():
    a = list(input())
    b = list(input())
    count = 0

    for i in range(3):
        if a[i] == b[i]:
            count = count + 1

    print(count)


if __name__ == '__main__' :
    main()
a,b = int(input())
print(a*b, 2*(a+b))

### FIXED CODE ###

nums = input().split(" ")
a =int( nums[0])
b = int(nums[1])

print(a*b, (a+b)*2)
N = int(input())
# n文字ぶんのsを書く
S = input()

result = 0
for i in range(N):
    1文字目から
    if S[i:i+2] == 'ABC':
        result += 1
print(result)

### FIXED CODE ###

N = int(input())
# n文字ぶんのsを書く
S = input()

result = 0
for i in range(N):
    # 1文字目から3文字なのでプラス3
    if S[i:i+3] == 'ABC':
        result += 1
print(result)
a=input()
if a=="A":
  print(T)
elif a!="A":
  print(A)
elif a=="C":
  print(G)
else:
  print(C)


### FIXED CODE ###

a=input()
if a=="A":
  print("T")
elif a=="T":
  print("A")
elif a=="C":
  print("G")
else:
  print("C")
s=input()
if a[0]==a[1]==a[2]:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

a=list(input())
if a[0]==a[1]==a[2]:
  print("No")
else:
  print("Yes")
from collections import deque
import numpy as np
import math

h, w = list(map(int, input().split()))
SHWs = [input() for i in range(h)]

def bfs(sy, sx):
    visited = [[-1]*w for i in range(h)]
    visited[sy][sx] = 0
    que = deque([[sy, sx]])
    while que:
        
        y,x = que.popleft()
        for i, j in [(1,0),(0,1),(-1,0),(0,-1)]:
            next_y, next_x = y+i, x+j
            # print(visited)
            if next_y < 0 or next_x < 0 or next_y > h-1 or next_x > w-1:
                continue
            if SHWs[next_y][next_x] == '.' and (visited[next_y][next_x] == -1 or visited[next_y][next_x] > visited[y][x]+1):
                visited[next_y][next_x] = visited[y][x] + 1
                que.append([next_y, next_x])
    
    return np.amax(np.array(visited))

            
ans = 0
for sy in range(h):
    for sx in range(w):
        if SHWs[sy][sx] == '#':
            continue
        count = bfs(sy=sy, sx=sx)

        if count > ans:
            ans = count


print(ans)



### FIXED CODE ###

c = input()
ordc = ord(c)

if ordc != 122:
    print(chr(int(ordc)+1))
else:
    print('a')
# AGC008A

def func(x, y):
    if y >= x:
        if x >= 0:
            return y - x
        else:
            if y > 0:
                if abs(x) > abs(y):
                    return 1 - x - y
                else:
                    return 1 + x + y
            elif y <= 0:
                return y - x
    else:
        if x >= 0:
            if y < 0:
                if abs(x) > abs(y):
                    return 1 + x + y
                else:
                    return 1 - x - y
            elif y == 0 or y == 1:
                return x + 1
            else:
                if abs(x) > abs(y):
                    return 1 + x + y
                else:
                    return 1 + y - x
        else:
            return 2 + x - y

x, y = map(int, input().split())
print(f(x, y))


### FIXED CODE ###

# AGC008A

def func(x, y):
    if y >= x:
        if x >= 0:
            return y - x
        else:
            if y > 0:
                if abs(x) > abs(y):
                    return 1 - x - y
                else:
                    return 1 + x + y
            elif y <= 0:
                return y - x
    else:
        if x >= 0:
            if y < 0:
                if abs(x) > abs(y):
                    return 1 + x + y
                else:
                    return 1 - x - y
            elif y == 0 or y == 1:
                return x + 1
            else:
                if abs(x) > abs(y):
                    return 1 + x + y
                else:
                    return 1 + y - x
        else:
            return 2 + x - y

x, y = map(int, input().split())
print(func(x, y))
while True:
    try:
        a = int(input())
        b = int(input())
    except EOFError:
        break
    if a <= 9 and b <= 9:
        print(a * b)
    else:
        print(-1)

### FIXED CODE ###

a,b=map(int, input().split())
if a<=9 and b<=9:
    print(a*b)
else:
    print(-1)
H,W = raw_input().split()
for height in range(H):
    if height == H-1 or height == 0:
        print "#"*W
    else:
        print "#"+ "."*(W-2)+"#\n"

### FIXED CODE ###

while True:
    h,w = tuple([int(x) for x in raw_input().split(" ")])
    if h==0 and w==0: break
 
    for ih in range(h):
        if ih==0 or ih==h-1 or w <= 2: print "#" * w
        else: print "#" + "." * (w-2) + "#"
 
    print ""
n, x = map(int, input().split())
l = list(map(int, input().split()))

X = 0
count = 0
while X <= x:
    X = X + l[count]
    count += 1
print(count)

### FIXED CODE ###

n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
c = 1
for i in l:
    d += i
    if d <= x:
        c += 1
    else:
        break
print(c)
N = input()
f = N % 10
if(f==3):
  print("bon")
elif(f==0,1,6,8):
  print("pon")
else:
  print("hon")

### FIXED CODE ###

N=int(input())
f = N % 10
if f==3:
  print("bon")
elif f==0 or f==1 or f==6 or f==8:
  print("pon")
else:
  print("hon")
K=int(input())
ans=0
for a in range(1,K):
    for b in range(1,K):
        for c in range(1,K):
            n=math.gcd(a,b,c)
            ans=ans+n

print(ans)

### FIXED CODE ###

import math
K=int(input())
k=K+1
ans=0
for a in range(1,k):
    for b in range(a,k):
        for c in range(b,k):
            m=math.gcd(a,b)
            o=math.gcd(m,c)
            if a==b and b==c:
                n=o
            elif a==b or b==c:
                n=o*3
            else:
                n=o*6
                
            ans+=n

print(ans)
s = list(input())

a = int(s[0])
b = int(s[2])

op = a[1]

if op == "+":
    print(a+b)
else:
    print(a-b)



### FIXED CODE ###

s = list(input().split())

a = int(s[0])
b = int(s[2])

op = s[1]

if op == "+":
    print(a+b)
else:
    print(a-b)
import sys
input = sys.stdin.readline

MAX_V = 10**9 + 7


def nCr(n, r):
    numerator = 1
    denominator = 1

    p = r if r < n-r else n-r

    for i in reversed(range(n-p+1, n+1)):
        numerator *= i

    for i in reversed(range(1, p+1)):
        denominator *= i

    return int(numerator / denominator)


n, b_k = map(int, input().split())
r_k = n-b_k
spot = r_k+1

min_k = min(b_k, spot)

for i in range(1, min_k+1):
    c = nCr(spot, i) * nCr(b_k-1, i-1)
    print(c % MAX_V)
    

### FIXED CODE ###

import sys
input = sys.stdin.readline
from math import factorial

MAX_V = 10**9 + 7

from math import factorial


def nCr(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(n - r) * factorial(r))

'''
def nCr(n, r):
    numerator = 1
    denominator = 1

    p = r if r < n-r else n-r

    for i in reversed(range(n-p+1, n+1)):
        numerator *= i

    for i in reversed(range(1, p+1)):
        denominator *= i

    return int(numerator / denominator)
'''

n, b_k = map(int, input().split())
r_k = n-b_k
spot = r_k+1

min_k = min(b_k, spot)

#for i in range(1, min_k+1):
for i in range(1, b_k+1):
    c = nCr(spot, i) * nCr(b_k-1, i-1)
    print(c % MAX_V)
Sa, Sb, Sc = open(0).read().split()
#print(Sa, Sb,Sc)
numSa = len(Sa)
numSb = len(Sb)
numSc = len(Sc)
#print(numSa,numSb,numSc)
i=j=k=0
flgA = True
flgB = flgC = False
l=0
while(True):
    if flgA == True:
        #print("A",i)
        flgA = False
        i+=1
        if numSa==i:
            print("A")
            break
        if Sa[i] == "a":
            flgA = True
        elif Sa[i] == "b":
            flgB = True
        else:
            flgC = True
    elif flgB == True:
        #print("B",j)
        flgB = False
        j+=1
        if numSb==j:
            pritn("B")
            break
        if Sb[j] == "a":
            flgA = True
        elif Sb[j] == "b":
            flgB = True
        else:
            flgC = True
    elif flgC == True:
       #print("C",k)
        flgC = False
        k+=1
        if numSc==k:
            print("C")
            break
        if Sc[k] == "a":
            flgA = True
        elif Sc[k] == "b":
            flgB = True
        else:
            flgC = True
    else:
        pass
    #print(l,"::",Sa[i],i,Sb[j],j,Sc[k],k)
        
    l+=1

### FIXED CODE ###

Sa, Sb, Sc = open(0).read().split()
# print(Sa, Sb,Sc)
numSa = len(Sa)
numSb = len(Sb)
numSc = len(Sc)
# print(numSa,numSb,numSc)
i=j=k=0
flgA = True
flgB = flgC = False
l=0
# noDebug = False
while(True):
    if flgA == True:
#         print("A",i)
        flgA = False
        if numSa==i:
             print("A")
#             noDebug = True
             break
        if Sa[i] == "a":
            flgA = True
        elif Sa[i] == "b":
            flgB = True
        else:
            flgC = True
        i+=1
    elif flgB == True:
#         print("B",j)
        flgB = False
        if numSb==j:
            print("B")
#             noDebug = True
            break
        if Sb[j] == "a":
            flgA = True
        elif Sb[j] == "b":
            flgB = True
        else:
            flgC = True
        j+=1
    elif flgC == True:
#         print("C",k)
        flgC = False
        if numSc==k:
            print("C")
#             noDebug = True
            break
        if Sc[k] == "a":
            flgA = True
        elif Sc[k] == "b":
            flgB = True
        else:
            flgC = True
        k+=1
    else:
        pass
#     if noDebug == False:
#         print(l)
#         print(l,"::",Sa[i],i,Sb[j],j,Sc[k],k) 
#     l+=1
A,V = map(int,input().split())
B,W= map(int,input().split())
T = int(input()
dist = abs(A-B)
vec = V-W
print('Yes' if vec*T >= dist else 'NO')

### FIXED CODE ###

A,V = map(int,input().split())
B,W= map(int,input().split())
T = int(input())
dist = abs(A-B)
vec = V-W
print('YES' if vec*T >= dist else 'NO')
N, K = map(int, input())
 
for i in range(N):
  dice = i+1
  result = 0
  calc = []
  count = 0
  while result <= K-1
    dice+=dice*2
    count+=1
  calc.append(1/N*(1/2)*count)

print(sum(calc))

### FIXED CODE ###

N, K = map(int, input().split())
 
calc = 0
for i in range(1, N+1):
  tmp = i
  cnt = 0
  while tmp <= K - 1:
    tmp*=2
    cnt+=1
  calc += (1/N) * (1/(2**cnt))

print(calc)
a,b,c=(int(X) for x in input().split())
print(int((a*b)/2))

### FIXED CODE ###

a,b,c=(int(x) for x in input().split())
print(int((a*b)/2))
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque

def check(max_length, left, right, r, index):
    if index == 100:
        print(left)
    half = (left + right) / 2
    if 2 * half <= max_length * (r - half) / r:
        check(max_length, half, right, r, index + 1)
    else:
        check(max_length, left, half, r, index + 1)

def main():
    data = [list(map(int, input().split())) for i in range(3)]
    a = ((data[0][0] - data[1][0]) ** 2 + (data[0][1] - data[1][1]) ** 2) ** 0.5
    b = ((data[1][0] - data[2][0]) ** 2 + (data[1][1] - data[2][1]) ** 2) ** 0.5
    c = ((data[0][0] - data[2][0]) ** 2 + (data[0][1] - data[2][1]) ** 2) ** 0.5

    s = (a + b + c) / 2
    S = (s * (s - a) * (s - b) * (s - c)) ** 0.5
    r = 2 * S / (a + b + c)

    left, right = 0, max(a, b, c)

    check(max(a, b, c), left, right, r, 0)





if __name__ == '__main__':
    main()
    # test()



### FIXED CODE ###

from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


import queue
from collections import deque

def check(max_length, left, right, r, index):
    if index == 1000:
        print(left)
        sys.exit()
    half = (left + right) / 2
    if 2 * half <= max_length * (r - half) / r:
        check(max_length, half, right, r, index + 1)
    else:
        check(max_length, left, half, r, index + 1)

def main():
    data = [list(map(int, input().split())) for i in range(3)]
    a = ((data[0][0] - data[1][0]) ** 2 + (data[0][1] - data[1][1]) ** 2) ** 0.5
    b = ((data[1][0] - data[2][0]) ** 2 + (data[1][1] - data[2][1]) ** 2) ** 0.5
    c = ((data[0][0] - data[2][0]) ** 2 + (data[0][1] - data[2][1]) ** 2) ** 0.5

    s = (a + b + c) / 2
    S = (s * (s - a) * (s - b) * (s - c)) ** 0.5
    r = 2 * S / (a + b + c)

    left, right = 0, max(a, b, c)

    check(max(a, b, c), left, right, r, 0)





if __name__ == '__main__':
    main()
    # test()