Problem:


Score : 100 points

Problem Statement

In order to pass the entrance examination tomorrow, Taro has to study for T more hours.

Fortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).

While (X \times t) hours pass in World B, t hours pass in World A.

How many hours will pass in World A while Taro studies for T hours in World B?

Constraints

All values in input are integers.

1 \leq T \leq 100

1 \leq X \leq 100

Input

Input is given from Standard Input in the following format:

T X

Output

Print the number of hours that will pass in World A.

The output will be regarded as correct when its absolute or relative error from the judge's output is at most 10^{-3}.

Sample Input 1

8 3

Sample Output 1

2.6666666667

While Taro studies for eight hours in World B where time passes three times as fast, 2.6666... hours will pass in World A.

Note that an absolute or relative error of at most 10^{-3} is allowed.

Sample Input 2

99 1

Sample Output 2

99.0000000000

Sample Input 3

1 100

Sample Output 3

0.0100000000



Sample input:
8 3


Sample output:
2.6666666667

Submission status: Runtime Error

Solution code:
num1 = input("input num1 :")

num2 = input("input num2 :")

ans = float(num1) / float(num2)

print(ans)

Submission status: Runtime Error

Solution code:
T, X = list(map(int, input().split())
print(T / X)

Submission status: Runtime Error

Solution code:
t, x = map(input())
a = t / x
print (a)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
diff = [0] * (m-1)
for i in range(m-1):
    diff[i] = x[i+1] - x[i]
diff.sort(reverse = True)
print(sum(diff[(n-1):]))

Submission status: Runtime Error

Solution code:
num = int(input().split())
ans = num[0] / num[1]
print(ans)

Submission status: Runtime Error

Solution code:
 #include <bits/stdc++.h>
 using namespace std;

 int main() {
 	double ans;
 	double T,X;
 	cin >> T>>X;
 	ans = T/(double(X));
 	cout << ans << endl;
 }

Submission status: Runtime Error

Solution code:
N = int(input())
Llist = list(map(int, input().split()))
 
sum = 0
for i in Llist:
  if i != max(Llist):
    sum += i
 
if max(Llist) <= sum:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
x,t = map(int, input().split())
print({}.format(float(x)/t))

Submission status: Runtime Error

Solution code:
import sys

arg = sys.argv
T = int(arg[1])
X = int(arg[2])
t = T / X
print(t)

Submission status: Runtime Error

Solution code:
import sys

def main():
    arg = sys.argv
    T = int(arg[1])
    X = int(arg[2])
    t = T / X
    print(t)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# Nの取得
index = int(input('input num : '))
 
# n回ループして配列に入れる
maximum = 0
other = 0
inputList = input().split()
for i in range(index):
    tmp = int(inputList[i])
    if tmp > maximum:
        maximum = tmp
        other = other + maximum
    else:
        other = other + tmp
 
if maximum <= tmp - maximum :
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
[print(t*x)for t,x in[[int(i) for i in　input().split()]]]

Submission status: Runtime Error

Solution code:
# C Streamline
n,m = map(int,input().split())
Xs = list(map(int,input().split()))

if n >= m:
    print('0')
    exit()

Xs.sort()
XsDist = []

for i in range(len(Xs)):
    if not i == 0:
        XsDist.append(Xs[i] - Xs[i-1])

XsDist.sort()
print(sum(XsDist[:n+1]))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(void)
{
    int t, x;
    cin >> t >> x;
    cout << (1.0 * t) / x << endl;

    return 0;
}

Submission status: Runtime Error

Solution code:
n,m=list(map(int,input().split(" ")))
list_x=list(map(int,input().split(" ")))

list_x.sort()
list_d=[]

if m<=n:
    print(0)
else:
    i=0
    while i<=m-2:
        list_d.append(list_x[i+1]-list_x[i])
        i+=1
    list_d.sort()
    print(sum(list_d[0:m-n:1]))

Submission status: Runtime Error

Solution code:
T,X=map(int,input().split())
return T/X

Submission status: Runtime Error

Solution code:
tb, x = input().split()
ta = tb/x
print(ta)

Submission status: Runtime Error

Solution code:
t, x = list(map(int, input()))

print(t/x)

Submission status: Runtime Error

Solution code:
n = int(input())
l = [int(i) for i in input().split()]

if max(l) < sum(l) - max(l) :
    print("Yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
T,X=map(int,inputs.split())
print(T/X)

Submission status: Runtime Error

Solution code:
T = int(T)
X = int(X)
t = T / X

Submission status: Runtime Error

Solution code:
T = input("T")
T = int(T)
X = input("X")
X = int(X)
t = T / X

Submission status: Runtime Error

Solution code:
t, x = map(double, input().split())
print(t/x)

Submission status: Runtime Error

Solution code:
T = int(input())
X = int(input())
print(T/X)

Submission status: Runtime Error

Solution code:
print(float(input())/float(input()))

Submission status: Runtime Error

Solution code:
x=input().split()
a=int(x[0])
b=int(x[1])
result=float(a/b)
result=round(result,10)
print(result)
x=input().slice()
a=int(x[0])
b=int(x[1])
result=float(a/b)
result=round(result,10)
print(result)

Submission status: Runtime Error

Solution code:
x=input().slice()
a=int(x[0])
b=int(x[1])
result=float(a/b)
result=round(result,10)
print(result)

Submission status: Runtime Error

Solution code:
    # -*- coding: utf-8 -*-
    import sys
    # ----------------------------------------------------------------
    # Use Solve Function
     
    def solve(lines):
        T,X = map(float, lines.pop(0).split(' '))
        print('{:.10f}'.format(T/X))
    #
    # main
    #
     
    # 1. use list instead of stdin
     
    # contents = '''\
    # 99 1\
    # '''
    # lines = contents.split('\n')
     
    # 2. use stdin
     
    lines = [x.strip() for x in sys.stdin.readlines()]
     
    #
    # solve !!
    #
    solve(lines)

Submission status: Runtime Error

Solution code:
T = int(input(""))
X = int(input(""))

if T < 1 or T > 100:
    exit()
if X < 1 or X > 100:
    exit()
print(T/X)

Submission status: Runtime Error

Solution code:
t, x = map(int, input(),split())
print(t/x)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
L = list(map(int, input().split()))
XOR = 0
result = []
for i in range(K+1):
  for LINT in L:
     XOR += i ^ LINT
  result.append(XOR)
print(max(result))

Submission status: Runtime Error

Solution code:
def main():
  t, x = map(int, input())
  print(float(t) / float(x))


main()

Submission status: Runtime Error

Solution code:
nandm = input().split()
numlist = input().split()
N = int(nandm[0])
M = int(nandm[1])
if N >= M:
    print(0)
else:
    intlist = [int(num) for num in numlist]
    intlist.sort()
    subtract = [intlist[i + 1] - intlist[i] for i in range(len(intlist) - 1)]
    subtract.sort()
    print(sum(subtract[:(M - N)]))

Submission status: Runtime Error

Solution code:
n = int(input())
a = input().split()
i = 0
while i < n:
  a[i] = int(a[i])
  i = i + 1 

i = 0
while i < n:
  j = i + 1
  while j < n:
    if a[i] < a[j]:
      temp = a[i]
      a[i] = a[j]
      a[j] = temp
    j = j + 1
  i = i + 1

sum = sum(a)
print(a[0])
if(sum-a[0] > a[0]):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
T = float(input())
X = float(input())

print("%.4f".format(T/X))

Submission status: Runtime Error

Solution code:
T = input()
X = input()

print("{0:.3f}".format(T/X))

Submission status: Runtime Error

Solution code:
l = list(map(float,input.split()))
m =l［0］/l［1］
print(m)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split( ))
datas = list(map(int, input().split( )))
datas.sort()
Ms = M - 1

dest = list()
K = 0
i = 0
for i in range(Ms):
  K = datas[i+1] - datas[i]
  dest.append(K)

dest.sort()
L = 0
MN = M - N
for j in range(MN):
  L = L + dest[j]

print(L)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split( ))
#print(N)
#print(M)
datas = list(map(int, input().split( )))
#print(datas)
datas.sort()
#print(datas)
Ms = M - 1

dest = list()
K = 0
i = 0
for i in range(Ms):
  K = datas[i+1] - datas[i]
  dest.append(K)
  dest.sort()
  #print(K)

#print(dest)
L = 0
MN = M - N
for j in range(MN):
  L = L + dest[j]

print(L)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split( ))
datas = list(map(int, input().split( )))
datas.sort()
Ms = M - 1

dest = list()
K = 0
i = 0
for i in range(Ms):
  K = datas[i+1] - datas[i]
  dest.append(K)
  dest.sort()

L = 0
MN = M - N

for j in range(MN):
  L = L + dest[j]

print(L)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
x = list(map(int, input().split()))

y = []
for i in range(m):
    y+= [x[i+1] - x[i]]
    
y.sort()

print(sum(y[:max(m-n, 0)]))

Submission status: Runtime Error

Solution code:
#abc117b

n=int(raw_input())
l=map(int,raw_input().split())
if max(l)>=sum(l)-max(l):
 print 'No'
else:
 print 'Yes'

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
T,X = a[0],a[1]
return(T/X)

Submission status: Runtime Error

Solution code:
t, x = map(int, input().split())
return t/x

Submission status: Runtime Error

Solution code:
T = input()
X = input()

return T/X

Submission status: Runtime Error

Solution code:
return T/X

Submission status: Runtime Error

Solution code:
T / X

Submission status: Runtime Error

Solution code:
print((lambda l:['No','Yes'][sum(l[:-1])>l[-1]])(sorted(list(map(int,[input()]+input().split()))[1:])))

Submission status: Runtime Error

Solution code:
X / T

Submission status: Runtime Error

Solution code:
import math

def main():
    data_num, max_num_10 = list(map(int, input().split()))
    data = list(map(int, input().split()))

    max_num_2 = bin(max_num_10)[2:]
    ketasuu = len(max_num_2)
    # keta_count = [0 for i in range(ketasuu)]

    max_ketasuu = ketasuu
    for point_10 in data:
        point_2 = bin(point_10)[2:]
        # print(point_2)
        if max_ketasuu < len(point_2):
            max_ketasuu = len(point_2)

    keta_count = [0 for i in range(max_ketasuu)]

    for point_10 in data:
        point_2 = bin(point_10)[2:][::-1]
        # print(point_2)
        for i in range(len(point_2)):
            if point_2[i] == '1':
                    keta_count[i] += 1
        # print(keta_count)

    ans = ''
    for i in range(ketasuu):
        if keta_count[i] >= math.ceil(data_num / 2):
            ans += '0'
        else:
            ans += '1'
    ans = ans[::-1]


    if max_num_10 < int(ans, 2):
        for i in range(ketasuu):
            if ans[i] == '1':
                # print(ans)
                ans = list(ans)
                # print(ans)
                ans[i] = '0'
                # print(ans)
                ans = ''.join(ans)
                # print(ans)
                break

    ans = ans[::-1]

    ans_count = 0
    now_point = 1

    for i in range(max_ketasuu):
        if i >= ketasuu:
            count_number = keta_count[i]
        else:
            if ans[i] == '1':
                count_number = data_num - keta_count[i]
            else:
                count_number = keta_count[i]
            # print(ans_count, now_point, count_number)
        ans_count += now_point * count_number
        now_point *= 2

    print(ans_count)



if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split(' '))

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

if not M >= N:
    print(0)
    exit()

x_list = sorted(x)

distance_list = []

for i in range(0, M-1):
    distance = x_list[i+1] - x_list[i]
    distance_list.append(distance)

result = sum(sorted(distance_list)[::-1][N-1:])
print(result)

Submission status: Runtime Error

Solution code:
import numpy as np

in_num = list(map(int, input().split()))
in_num2 = list(map(int, input().split()))
n = in_num[0]
k = in_num[1]
a = np.asarray(in_num2)
#n = 10**5
#k = 10**12
#a = np.asarray(np.arange(10**12))
if False:# k == 0 :
    print(np.sum(a))
    exit
else:
    max = 0
    ktmp = 0
    flag = 1 if k == 0 else 0
    i = 1
    while True:
        tmp = len(a[a%2==1])
        ktmp += i if tmp > n - tmp or flag == 1 else 0
        if ktmp > k:
            break
        tmp = tmp if tmp > n - tmp or flag == 1 else n - tmp 

        max += tmp * i
        #print(tmp,max,i,np.max(a))
        a = np.trunc(a / 2)
        i = i * 2
        if i > k:
            flag = 1
            if 0 ==  np.max(a):
                break

    print(max)

Submission status: Runtime Error

Solution code:
def napsach(N, W, v, w):
    if N == 0 or K == 0:
        return 0
    V = []
    for i in range(N):
        V.append([0] * W)

    for i in range(N):
        for j in range(W):
            if i == 0:
                if j + 1 >= w[i]:
                    V[i][j] = v[i]
            else:
                if j + 1 >= w[i]:
                    V[i][j] = max(V[i - 1][j], V[i - 1][j + 1 - w[i]] + v[i])
                else:
                    V[i][j] = V[i - 1][j]
    return V[-1][-1]

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

A_max = max(A)
max_val = max(A_max, K)

i = 0
tot_val = 0
w = []
v = []

while (1 << i) <= max_val:
    temp_w = 0
    for j in range(N):
        temp_w += (A[j] >> i) & 1
    temp_w = N - temp_w
    tot_val += (1 << i) * (N - temp_w)
    if temp_w * 2 > N:
        w.append(1 << i)
        v.append((1 << i) * (2 * temp_w - N))
    i += 1
print(tot_val + napsach(len(v), K, v, w))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split(' '))

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

if not M >= N:
    print(0)
    exit()

x_list = sorted(x)

distance_list = []

for i in range(1, M):
    distance = x_list[i-1] - x_list[i]
    distance_list.append(distance)

result = abs(sum(sorted(distance_list)[::-1][:N+1]))
print(result)

Submission status: Runtime Error

Solution code:
#coding: utf-8
N, M = map(int, input().split())
points = list(map(int, input().split()))
points.sort()
koma = [points[i+1] - points[i] for i in range(M-1)]
koma.sort()
print(sum(koma[:M-N]))

Submission status: Runtime Error

Solution code:
n,m = list(map(int, input().split()))
x = list(map(int, input().split()))

if n >= m:
    print(0)
    exit()
else:
    difference = []
    x.sort()
 
    for i in range(m-1):
        difference.append(x[i+1]-x[i])
 
    difference.sort()
 
    print(sum(difference[:n-1]))

Submission status: Runtime Error

Solution code:
a,b=map(int,input(),split())
print(a/b);

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())
x = [int(i) for i in input().split()]
x.sort()
x2 = []
for i in range(len(x)-1):
  x2.append(x[i+1] - x[i])
x2.sort()
if n < m:
  print(sum(x2[:len(x2) - n + 1]))
else:
  print('0')

Submission status: Runtime Error

Solution code:
n, m = [int(i) for i in input().split()]
x_arr = [int(i) for i in input().split()]

x_sort = sorted(x_arr)

if n >= m:
    print(0)
else:
    x_sub = [x_sort[i+1]-x_sort[i] for i in range(m-1)]
    x_sub = sorted(x_sub)
    
    print(sum(x_sub[:-(n-1)]))

Submission status: Runtime Error

Solution code:
def itinokazu(A,i):#配列Aのi桁目の１の数を調べる
    kazu=0
    for a in A:
        bina=bin(a)
        if a>=2**(i-1):
            if bina[i*-1]=='1':
                kazu=kazu+1
    return kazu

import math
N,K=[int(i) for i in input().split()]
A=list(map(int,input().split()))
Maxkazu=max(max(A),K)#桁の上限を探す(Kの2進数での桁数を考える)
Keta=math.floor(math.log2(Maxkazu))+1
presentA=0
print(Keta)
presentAns=0
for i in reversed(range(Keta+1)):#i桁目(2^i-1)の位について
    ichinokazu=itinokazu(A,i)
    if (2*ichinokazu>N) or presentA+2**(i-1)>K:#i桁目が1のほうが多い、もしくは1にすると超えちゃう場合はAのi桁目は0
        presentAns=presentAns+((2**(i-1))*ichinokazu)
    else:
        presentA=presentA+2**(i-1)#そうでなければAのi桁目は1
        presentAns=presentAns+((2**(i-1))*(N-ichinokazu))
print(int(presentAns))

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
X=list(map(int,input().split()))
if(len(X)<=N):
  print(0)
else:
  #print(N,M,X)
  sort_X=sorted(X)
  #print(sort_X)
  #print(sort_X[1:],sort_X[0:len(sort_X)-1])
  X_sa=[x - y for (x, y) in zip(sort_X[1:], sort_X[0:len(X)-1])]
  #print(X_sa)
  sort_X_sa=sorted(X_sa)
  #print(sort_X_sa)
  #print(sort_X_sa[:M-N])
  print(sum(sort_X_sa[:M-N]))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
X = list(map(int, input().split()))

XS = sorted(X)
XD = []
for i in range(0, len(XS)-1):
    XD.append(XS[i + 1] - XS[i])

XD2 = sorted(XD)
print(sum(XD2[:M-N]))

Submission status: Runtime Error

Solution code:
#coding: utf-8
N, M = map(int, input().split())
points = list(map(int, input().split()))
points = sorted(points)
koma = [points[i+1] - points[i] for i in range(M-1)]
koma.sort(reverse=True)
print(sum(koma[:M-N]

Submission status: Runtime Error

Solution code:
import math

def main():
    data_num, max_num_10 = list(map(int, input().split()))
    data = list(map(int, input().split()))

    max_num_2 = bin(max_num_10)[2:]
    ketasuu = len(max_num_2)

    max_ketasuu = ketasuu
    for point_10 in data:
        point_2 = bin(point_10)[2:]
        if max_ketasuu < len(point_2):
            max_ketasuu = len(point_2)

    keta_count = [0 for i in range(max_ketasuu)]

    for point_10 in data:
        point_2 = bin(point_10)[2:][::-1]
        # print(point_2)
        for i in range(len(point_2)):
            if point_2[i] == '1':
                    keta_count[i] += 1
        # print(keta_count)

    ans = ''
    for i in range(ketasuu):
        if keta_count[i] >= math.ceil(data_num / 2):
            ans += '0'
        else:
            ans += '1'
    ans = ans[::-1]

    # asn = '1100'
    # max_num_2 = '1001'
    # ketasuu = 4


    if max_num_10 < int(ans, 2):
        # print('yyy')
        count = 1
        for i in range(ketasuu)[::-1]:
            if ans[i] == '1' and max_num_2[i] == '0':
                # print('uyt', count)
                if max_num_10 >= int(ans, 2) - count:
                    # print('uuuuu')
                    # print(ans)
                    ans = list(ans)
                    # print(ans)
                    ans[i] = '0'
                    # print(ans)
                    ans = ''.join(ans)
                    # print(ans)
                    break
        if max_num_10 < int(ans, 2)
            ans = list(ans)
            # print(ans)
            ans[0] = '0'
            # print(ans)
            ans = ''.join(ans)
            # count *= 2

    ans = ans[::-1]

    ans_count = 0
    now_point = 1

    for i in range(max_ketasuu):
        if i >= ketasuu:
            count_number = keta_count[i]
        else:
            if ans[i] == '1':
                count_number = data_num - keta_count[i]
            else:
                count_number = keta_count[i]
            # print(ans_count, now_point, count_number)
        ans_count += now_point * count_number
        now_point *= 2

    print(ans_count)

def test():
    ans = '1110'
    max_num_2 = '1011'
    ketasuu = 4
    max_num_10 = 11

    if max_num_10 < int(ans, 2):
        # print('yyy')
        count = 1
        for i in range(ketasuu)[::-1]:
            if ans[i] == '1' and max_num_2[i] == '0':
                print('uyt', count)
                if max_num_10 >= int(ans, 2) - count:
                    print('uuuuu')
                    # print(ans)
                    ans = list(ans)
                    # print(ans)
                    ans[i] = '0'
                    # print(ans)
                    ans = ''.join(ans)
                    # print(ans)
                    break
            count *= 2

    # ans = ans[::-1]
    print(ans)

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

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict
import math
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

#A
"""
t,x = LI()
print(t/x)
"""

#B
"""
n= II()
a = LI()
m = max(a)
if m >= sum(a)-m:
    print("No")
else:
    print("Yes")
"""

#C
"""
n,m = LI()
x = LI()
x.sort()
l = [x[i+1]-x[i] for i in range(m-1)]
l.sort()
l = l[::-1]
ans = sum(l[max(n-1,0):])
print(ans)
"""

#D
n,k = LI()
a = LI()
l = 0
b = [0 for i in range(n)]
for i in range(n):
    b[i] = list(bin(a[i]))[2:]
    l = max(l,len(b[i]))
s = [0 for i in range(l)]
for i in range(n):
    for j in range(l-len(b[i])):
        b[i].insert(0,"0")
for i in range(n):
    for j in range(l):
        s[j] += 1-int(b[i][j])
ke = 1
ans = 0
i = l-1
while i >= 0:
    if s[i] <= n//2:
        ans += (n-s[i])*ke
        s.pop(i)
    else:
        ans += (n-s[i])*ke
        s[i] = [(2*s[i]-n)*ke,ke]
    i -= 1
    ke *= 2
s.sort(key = lambda x:x[0])
s = s[::-1]
d = 0
key = len(list(bin(k)))-2
key -= l
ke = 2**l
for i in range(key):
    d += ke
    ans += n*ke
    ke *= 2
w = len(s)
if w == 0:
    print(ans)
    quit()
b = ans
c = d
for i in range(w):
    q,p = s[i]
    if d+p <= k:
        d += p
        ans += q
import random
for j in range(10):
    a = b
    e = c
    l = [i for i in range(w)]
    for _ in range(w-1):
        i = random.randint(0,len(l)-1)
        i = l.pop(i)
        q,p = s[i]
        if e+p <= k:
            e += p
            a += q
    ans = max(ans,a)
print(ans)
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Runtime Error

Solution code:
def read():
    N, K = list(map(int, input().strip().split()))
    A = list(map(int, input().strip().split()))
    return N, K, A


def binary_digits(x):
    digit = 0
    while x > 0:
        x >>= 1
        digit += 1
    return digit


def maximum_X(N, K, A):
    digitK = binary_digits(K)
    counts = []
    bitmask = 1
    for d in range(digitK):
        count = 0
        for i in range(N):
            if A[i] & bitmask == bitmask:
                count += 1
        counts.append(count)
        bitmask <<= 1

    X = 0
    bitmask = 1
    for d in range(digitK):
        if counts[d] * 2 <= N:
            if K & bitmask == bitmask:
                X += bitmask
        bitmask <<= 1
    return X


def f(x, A):
    y = 0
    for a in A:
        y += (x ^ a)
    return y


def solve(N, K, A):
    X = maximum_X(N, K, A)
    return f(X, A)


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
X=list(map(int,input().split()))
#print(N,M,X)
sort_X=sorted(X)
#print(sort_X)
#print(sort_X[1:],sort_X[0:len(sort_X)-1])
X_sa=[x - y for (x, y) in zip(sort_X[1:], sort_X[0:len(X)-1])]
#print(X_sa)
sort_X_sa=sorted(X_sa)
#print(sort_X_sa)
#print(sort_X_sa[0:M-N])
print(sum(sort_X_sa[0:M-N]))

Submission status: Runtime Error

Solution code:
K = int(input().split()[1])
As = [int(i) for i in input().split()]
As.sort(reverse=True)
bit_num = len(bin(K))-2
arr = [[int(s) for s in format(val,'b').zfill(bit_num)] for val in As]
temp = [0]*len(As)
for j in range(len(arr[0])):
    for i in range(len(arr)):
        temp[j] += arr[i][j]
ans = int("".join(["0" if i>len(arr)/2 else "1" for i in temp]), 2)
ans = ans if ans < K else K
print(sum([ans^i for i in As]))

Submission status: Runtime Error

Solution code:
import numpy as np

N, K = map(int, input().split())
rawdata = np.array([int(i) for i in input().split()])
setRange = np.reshape(np.arange(K+1), (K+1,1))

def df_calc(X, A):
    return X^A
vfunc = np.vectorize(df_calc)

res = vfunc(rawdata, setRange)
res = np.sum(res, axis=1).max()
print(res)

Submission status: Runtime Error

Solution code:
t=T/X
print(t)

Submission status: Runtime Error

Solution code:
import numpy as np
N,K =list(map(int, input().split()))
X = input().split()
for i in range(len(X)):
    X[i] = int(X[i])
X = np.array(X)

keta = len(bin(K))-2
matrix = np.zeros(keta*N).reshape(N,keta)
i_count=0
for i in X:
    for j in range(min(len(bin(i)[2:]),keta)):
        matrix[i_count,-j-1] = bin(i)[-j-1]
    i_count+=1
    
    

tot = np.zeros(keta)
for i in range(keta):
    tot[i]=sum(matrix[:,i])

ans = np.zeros(keta)
for i in range(len(tot)):
    if int(tot[i]) < N/2:
        ans[i]=int(1)




answer = ''

for i in ans:
    answer += str(int(i))

an=int(answer,2)




ind =100
if an > K:
    cand = np.where(ans==1)[0]
    ind = -1
    
    while an > K:
        lis = list(ans)
        lis[cand[ind]] = 0
        answer = ''
        for i in lis:
            answer += str(int(i))
        lis[cand[ind]] = 1
        an=int(answer,2)
        ind -= 1
        
    ind +=1
    

j = tot
for i in range(len(j)):
    j[i] = max(j[i],N-j[i])
if ind<50:
    j[ind] = N-j[ind]

b = 0
for i in range(len(j)):
    b  += int(j[-i-1])*(2**i)
print(b)

Submission status: Runtime Error

Solution code:
N, M = list(map(int, input().split()))
X_list = sorted(list(map(int, input().split())))
result_list =[]
for i in range(M):
    result = 0
    for x in X_list:
        result += i ^ x
    result_list.append(result)
if len(result_list)==0:
    print(X_list[0])
else:
    print(max(result_list))

Submission status: Runtime Error

Solution code:
import numpy as np

in_num = list(map(int, input().split()))
in_num2 = list(map(int, input().split()))
n = in_num[0]
k = in_num[1]
a = np.asarray(in_num2)

if k == 0 :
    print(np.sum(a))
else:

    b = np.arange(k).reshape(k,1) + 1
    c = np.bitwise_xor(a,b)

    print(np.max(np.sum(c,axis=1)))

Submission status: Runtime Error

Solution code:
K = int(input().split()[1])
As = [int(i) for i in input().split()]
As.sort(reverse=True)
print(bin(K))
bit_num = len(bin(K))-2
arr = [[int(s) for s in format(val,'b').zfill(bit_num)] for val in As]
arr = [sum(arr[i][j] for i in range(len(arr))) for j in range(len(arr[0]))]
ans = int("".join(["0" if i>len(arr)/2 else "1" for i in arr]), 2)
ans = ans if ans < K else K
print(sum([ans^i for i in As]))

Submission status: Runtime Error

Solution code:
import numpy as np

in_num = list(map(int, input().split()))
in_num2 = list(map(int, input().split()))
n = in_num[0]
k = in_num[1]
a = np.asarray(in_num2)

if k == 0 :
    print(np.sum(a))
else:

    b = np.arange(k).reshape(k,1) + 1
    result = np.bitwise_xor(a,b)

    print(np.max(np.sum(result,axis=1)))

Submission status: Runtime Error

Solution code:
# D

# 10^12 < 2^40

def hard_log2(N):
    
    r = 1
    l = 0
    while N >= 2*r:
        r *= 2
        l += 1
    return r, l

def maximize_simple(r_list, K, N):
    if K == 0:
        return 0
    R = 0
    L, M = hard_log2(K)
    for i in range(M+1):
        R += max(r_list[i], N - r_list[i])*(2**i)
        
    return R

def maximize(r_list, K, N):
    
    if K == 0:
        return 0
    
    L, M = hard_log2(K)
    
    if r_list[M] >= N - r_list[M]:
        return maximize_simple(r_list, L-1, N)+r_list[M]*(2**M)
    else:
        R = 0
        m = M
        while 2**m > K-L:
            R += (N-r_list[m])*(2**m)
            m -= 1
        
        return max(maximize(r_list, K-L, N)+R, maximize_simple(r_list, L-1, N)+r_list[M]*(2**M))

def main_d(A_list, N, K):
    r_list = [0]*41
    for i in range(41):
        for A in A_list:
            if (A % 2**(i+1)) >= 2**i:
                r_list[i] += 1
    if K == 0:
        R = 0
        for i in range(41):
            R += r_list[i]*(2**i)
        return R
    L, M = hard_log2(K)
    R = 0
    for i in range(M+1, 41):
        R += r_list[i]*(2**i)
    return R + maximize(r_list, K, N)
    

if __name__ == "__main__":
    N, K = map(int, input().split())
    A_list = list(map(int, input().split()))
    res = main_d(A_list, N, K)

    
    print(res)

Submission status: Runtime Error

Solution code:
K = int(input().split()[1])
As = [int(i) for i in input().split()]
As.sort(reverse=True)
bit_num = len(bin(K))-2
arr = [[int(s) for s in format(val,'b').zfill(bit_num)] for val in As]
# ここか？
arr = [sum([arr[i][j] for i in range(len(arr))]) for j in range(len(arr[0]))]

Submission status: Runtime Error

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
l = [int(x) for x in stdin.readline().rstrip().split()]
max = max(l)
sum = sum(l, -1*max)
print("Yes") if sum > max else print("No")

Submission status: Runtime Error

Solution code:
a, b = map(int. input().split(' '))
print(a * b)

Submission status: Runtime Error

Solution code:
NK = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]

N = NK[0]
K = NK[1]

max_ = 0
for i in range(K + 1):
    print(i)
    f = 0
    for j in L:
        f = f + (i ^ j)
    if max_ < f:
        max_ = f

print(max_)

Submission status: Runtime Error

Solution code:
K = int(input().split()[1])
As = [int(i) for i in input().split()]
As.sort(reverse=True)
bit_num = len(bin(K))-2
arr = [[int(s) for s in format(val,'b').zfill(bit_num)] for val in As]
arr = [sum([arr[i][j] for i in range(len(arr))]) for j in range(len(arr[0]))]
ans = int("".join(["0" if i>len(arr)/2 else "1" for i in arr]), 2)
ans = ans if ans < K else K
print(sum([ans^i for i in As]))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

l = []
sum = 0
  
for i in range(0, k+1):
  for j in a:
    sum += i ^ j
  l.append(sum)
  sum = 0


print(max(l))

Submission status: Runtime Error

Solution code:
s = int(input())
A = list(map(int, input().split())) 
m = max(A)
if sum(A) - int(m) > int(m):
    print("Yes")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
x.t = map(int,input().split())
print(x/t)

Submission status: Runtime Error

Solution code:
import numpy as np
K = int(input().split()[1])
As = [int(i) for i in input().split()]
As.sort(reverse=True)
bit_num = len(bin(K))-2
arr = np.array([[int(s) for s in format(val,'b').zfill(bit_num)] for val in As])
ans = int("".join(["0" if i>arr.shape[0]/2 else "1" for i in np.sum(arr, axis=0)]), 2)
ans = ans if ans < K else K
print(sum([ans^i for i in As]))

Submission status: Runtime Error

Solution code:
#!venv/bin/python

N,K = [int(x) for x in input().split()]
A = [format(int(x), 'b') for x in input().split()]

count_1 = [0 for i in range(40)]
count_0 = [0 for i in range(40)]

print(A)

for a in A:
    for i in range(40):
        if i >= len(a):
            count_0[i] += 1
            continue
        if a[-(i+1)] == "1":
            count_1[i] += 1
        else:
            count_0[i] += 1
        
k = 0
for i in range(39,0,-1):
    if 2 ** i + k > K:
        continue
    if count_0[i] > count_1[i]:
        k += 2 ** i

ans = 0
for a in A:
    ans += k ^ int(a,2)
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

# 整数の入力
N = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
l = list(map(int, input().split()))
max = max(l)
#for i in l:
#    print(i)

num = 0
for i in l:
    num=i+num
num = num-max
print(num)
print(max)
if num >= max:
    print("Yes")
else:
    print("No")
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

Submission status: Runtime Error

Solution code:
T = int(input())
X = int(input())
print(float(T)/float(X))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

# 整数の入力
N = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
l = list(map(int, input().split()))
max = max(l)
#for i in l:
#    print(i)

num = 0
for i in l:
    num=i
num = num-max
if num >= max:
    print("Yes")
else:
    print("No")
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

Submission status: Runtime Error

Solution code:
T = input()
X = input()

print(float(T)/float(X))