Problem:


Score : 600 points

Problem Statement

We have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes N-1 or smaller.

Determine the largest element in the sequence (if there is more than one, choose one). Decrease the value of this element by N, and increase each of the other elements by 1.

It can be proved that the largest element in the sequence becomes N-1 or smaller after a finite number of operations.

You are given an integer K. Find an integer sequence a_i such that the number of times we will perform the above operation is exactly K. It can be shown that there is always such a sequence under the constraints on input and output in this problem.

Constraints

0 ≤ K ≤ 50 \times 10^{16}

Input

Input is given from Standard Input in the following format:

K

Output

Print a solution in the following format:

N
a_1 a_2 ... a_N

Here, 2 ≤ N ≤ 50 and 0 ≤ a_i ≤ 10^{16} + 1000 must hold.

Sample Input 1

0

Sample Output 1

4
3 3 3 3

Sample Input 2

1

Sample Output 2

3
1 0 3

Sample Input 3

2

Sample Output 3

2
2 2

The operation will be performed twice: [2, 2] -> [0, 3] -> [1, 1].

Sample Input 4

3

Sample Output 4

7
27 0 0 0 0 0 0

Sample Input 5

1234567894848

Sample Output 5

10
1000 193 256 777 0 1 1192 1234567891011 48 425



Sample input:
0


Sample output:
4
3 3 3 3

Submission status: Wrong Answer

Solution code:
def main():
    k = int(input())

    if k == 0:
        print(4)
        print(3, 3, 3)
        return
    if k == 1:
        print(3)
        print(1, 0, 3)
        return
    if k <= 50:
        print(k)
        print(' '.join([str(k)]*k))
        return
    print(50)
    res = [k//50]*50
    for i in range(k%50):
        res[i] += 1
    print(' '.join([str(i) for i in res]))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
K = int(input())

if K%2:
    a1, a2 = (K+1)//2 + 2, (K+1)//2 - 1
else:
    a1, a2 = K//2 + 1, K//2 + 1
                
print("2\n{} {}".format(a1, a2))

Submission status: Wrong Answer

Solution code:
n=int(raw_input())
if n%2==0:
    print 2
    print n/2+1,n/2+1
else:
    print 2
    print (n-1)/2,(n-1)/2+3

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
K = int(input())

if K%2:
    a1, a2 = (K+1)//2 + 2, (K+1)//2 - 1
else:
    a1, a2 = K//2 + 1, K//2 + 1
                
print("{} {}".format(a1, a2))

Submission status: Wrong Answer

Solution code:
k = int(input())
if k <= 100 * 1000:
    if k % 2:
        print(2)
        print(k // 2, 2 + k // 2)
    else:
        print(2)
        print(1 + k // 2, 1 + k // 2)
else:
    mn = k // 50
    md = k % 50
    print(50)
    for i in range(49):
        print(49 + mn - md, end=" ")
    print(49 + mn + 50 * md)

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3

K = int(input())


N = 1
print(N)
print(str(K * N + (N - 1)))

Submission status: Wrong Answer

Solution code:
K = int(input())

n = 50

b = K // n

a = [b * n for i in range(n)]

for i in range(n - 1):
    if b == 0:
        continue
    a[i] -= K % n
a[n - 1] += (K % n) * n

print(len(a))
print(' '.join(str(s) for s in a))

Submission status: Wrong Answer

Solution code:
k=int(input())

for n in range(50, 1, -1):
    if k % n == 0:
        x = k//n+(n-1)
        print(n)
        print(*[x]*n)
        break

Submission status: Wrong Answer

Solution code:
K = int(input())

if K == 0:
    print(4)
    print(' '.join(str(x) for x in [3, 3, 3, 3]))
else:
    N = 100000
    s = ' 0' * (N - 1)
    print(N)
    print(str(K * N + (N - 1)) + s)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))


def read():
    K = II()
    return (K,)


def solve(K):
    k_div, k_mod = divmod(K, 10 ** 16)
    N = k_div + 2
    a = [k_div + 1] * N
    ano_div, ano_mod = divmod(K, N)
    for i in range(N):
        a[i] += ano_div
    if ano_mod != 0:
        for i in range(ano_mod):
            a[i] += N - (ano_mod - 1)
        for i in range(ano_mod, N):
            a[i] += -ano_mod

    ans = "{}\n".format(k_div + 2) + " ".join(map(str, a))

    return ans


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
k=int(input())

for n in range(50, 2, -1):
    if k % n == 0:
        x = k//n+(n-1)
        print(n)
        print(*[x]*n)
        break

Submission status: Wrong Answer

Solution code:
def show1(n, ans):
    for i in xrange(n):
        print ans[i],
    print

def show2(n, m, l, ans):
    for i in xrange(l):
        print ans[i] + 50 * m + 1,
    for i in xrange(l, n):
        print ans[i] + 50 * m ,
    print

k = int(raw_input())
n = 50
ans = [0] * n
print n
if k <= n:
    for i in xrange(k):
        ans[i] = n - i
    show1(n, ans)
else:
    ans = range(50, 0, -1)
    m = k / 50 - 1
    l = k % 50
    show2(n, m, l, ans)

Submission status: Wrong Answer

Solution code:
K = int(input())

def solve(K):
    if K == 0:
        return [3, 3, 3, 3]
    if K == 1:
        return [1, 0, 3]
    if K == 2:
        return [2, 2]
    if K <= 2 * 10**16 - 10:
        if K % 2 == 0:
            return [K//2 + 1, K//2 + 1]
        else:
            return [K//2 - 1, K//2 + 2]
    N, R = divmod(K, 10**16)
    if R != 0:
        N = N + 1
    if N <= 2:
        N = 3
    a = K//N
    r = K - N * a
    if r == 0:
        return [N - 1 + a] * N
    ret = [N + a] * N
    for i in range(N - r):
        ret[i] -= (N + 1)
        for j in range(N):
            ret[j] += 1
    return ret


ans = solve(K)
print(len(ans))
print(*ans)

Submission status: Wrong Answer

Solution code:
def show1(n, ans):
    for i in xrange(n):
        print ans[i],
    print

def show2(n, m, l, ans):
    for i in xrange(l):
        print ans[i] + 50 * m + 1,
    for i in xrange(l, n):
        print ans[i] + 50 * m ,
    print

k = int(raw_input())
n = 50
ans = [0] * n
print n
if k <= n:
    for i in xrange(k):
        ans[i] = n - i
    show1(n, ans)
else:
    ans = range(50, 0, -1)
    m = k / 50
    l = k % 50
    show2(n, m, l, ans)

Submission status: Wrong Answer

Solution code:
k = int(input())

if k <= 2 * 10**16:
    n = 2
    if k % 2 == 0:
        a = [k // 2 + 1, k // 2 + 1]
    else:
        a = [k // 2 + 3, k // 2]
else:
    n = 50
    a = [k // n + n - 1 for _ in range(50)]
    for i in range(k % n):
        for j in range(n):
            if j == i:
                a[j] += n
            else:
                a[j] -= 1
print(' '.join(map(str, a)))

Submission status: Wrong Answer

Solution code:
K = int(input())

def solve(K):
    if K == 0:
        return [3, 3, 3, 3]
    if K == 1:
        return [1, 0, 3]
    if K == 2:
        return [2, 2]
    if K <= 2 * 10**16 - 10:
        if K % 2 == 0:
            return [K//2 + 1, K//2 + 1]
        else:
            return [K//2 - 1, K//2 + 2]
    N, R = divmod(K, 10**16)
    if R != 0:
        N = N + 1
    a = K//N
    r = K - N * a
    if r == 0:
        return [N - 1 + a] * N
    ret = [N + a] * N
    for i in range(N - r):
        ret[i] -= (N + 1)
        for j in range(N):
            ret[j] += 1
    return ret


ans = solve(K)
print(len(ans))
print(*ans)

Submission status: Wrong Answer

Solution code:
K = int(input())

if K == 0:
    print(4)
    print(' '.join(str(x) for x in [3, 3, 3, 3]))
else:
    print(7)
    print(' '.join(str(x) for x in [K * 7 + 6, 0, 0, 0, 0, 0, 0]))

Submission status: Wrong Answer

Solution code:
K = int(input())

def solve(K):
    if K == 0:
        return [3, 3, 3, 3]
    if K == 1:
        return [1, 0, 3]
    if K == 2:
        return [2, 2]
    if K <= 2 * 10**16:
        if K % 2 == 0:
            return [K//2 + 1, K//2 + 1]
        else:
            return [K//2 - 1, K//2 + 2]
    N, R = divmod(K, 10**16)
    if R != 0:
        N = N + 1
    a = K//N
    r = K - N * a
    if r == 0:
        return [N - 1 + a] * N
    ret = [N + a] * N
    for i in range(N - r):
        ret[i] -= (N + 1)
        for j in range(N):
            ret[j] += 1
    return ret


ans = solve(K)
print(len(ans))
print(*ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==0:
    print(2)
    print('1 1')
else:
    print(1)
    print(-1)

Submission status: Wrong Answer

Solution code:
n=int(input())
print(2)
if n%3==1:
	print(0,n+1)
else:
	print(1,n)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))


def read():
    K = II()
    return (K,)


def solve(K):
    k_div, k_mod = divmod(K, 10 ** 16)
    a = [k_div + 1] * (k_div + 2)
    if k_div == 0:
        if k_mod == 1:
            a = [2, 0]
        else:
            a[0] += k_mod
    else:
        for i in range(k_div):
            a[i] += 10 ** 16
        else:
            a[k_div] += k_mod

    ans = "{}\n".format(k_div + 2) + " ".join(map(str, a))

    return ans


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
K = int(input())

def solve(K):
    if K == 0:
        return [3, 3, 3, 3]
    if K == 1:
        return [1, 0, 3]
    if K == 2:
        return [2, 2]
    if K <= 2 * 10**16:
        if K % 2 == 0:
            return [K//2 + 1, K//2 + 1]
        else:
            return [K//2 - 1, K//2 + 2]
    N, R = divmod(K, 10**16)
    if R != 0:
        N = N + 1
    a = K//N + 1
    r = K - N * (a - 1)
    if r == 0:
        return [a] * N
    ret = [a + 1] * N
    for i in range(N - r):
        ret[i] -= (N + 1)
        for j in range(N):
            ret[j] += 1
    return ret


ans = solve(K)
print(len(ans))
print(*ans)

Submission status: Wrong Answer

Solution code:
K=int(input())
R=K%50
L=K-R
a=[49+L-R]*50
for i in range(R):
  a[i]+=51
print(50)
print(' '.join(map(str, a)))

Submission status: Wrong Answer

Solution code:
K = int(input())

def solve(K):
    if K == 0:
        return [3, 3, 3, 3]
    if K == 1:
        return [1, 0, 3]
    if K == 2:
        return [2, 2]
    if K <= 2 * 10**16:
        if K % 2 == 0:
            return [K//2, K//2]
        else:
            return [K//2 - 1, K//2 + 2]
    N, R = divmod(K, 10**16)
    if R != 0:
        N = N + 1
    a = K//N
    r = K - N * a
    if r == 0:
        return [a] * N
    ret = [a + 1] * N
    for i in range(N - r):
        ret[i] -= (N + 1)
        for j in range(N):
            ret[j] += 1
    return ret


ans = solve(K)
print(len(ans))
print(*ans)

Submission status: Wrong Answer

Solution code:
K=int(input())
R=K%50
L=K-R
a=[49+L-R]*50
for i in range(R):
  a[i]+=51
print(50)
print(a)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
  N = 50
  K = int(raw_input())
  A = [N - 1 + (K / N)] * N
  K %= N
  A[0] += K * N
  for i in xrange(1, N):
    A[i] -= K
  print N
  print ' '.join(map(str, A))

main()

Submission status: Wrong Answer

Solution code:
K = int(input())
a = [K // 2, K // 2 + 1]
if K % 2 == 1:
    a[1] += 1
print(2)
print(" ".join(map(str, a)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    K = int(input())
    a = [K // 2, K // 2 + 1]
    if K % 2 == 1:
        a[1] += 1
    print(" ".join(map(str, a)))
    return


main()

Submission status: Wrong Answer

Solution code:
K = int(input())

if K % 2 == 0:
    print(2)
    a = K // 2 + 1
    print(a, a)
else:
    print(2)
    a = (K - 1) // 2 + 1
    b = (K + 1) // 2 + 1
    print(a - 1, b)

Submission status: Wrong Answer

Solution code:
MIN_N = 2
MAX_N = 50
MAX_A0 = 10 ** 16 + 1000


def solve(k):
    n = 1
    a0 = -MAX_A0
    for n_cand in range(MIN_N, MAX_N + 1):
        a0_cand = n_cand * (k + 1) - 1
        if a0 < 0 or a0 < a0_cand <= MAX_A0:
            n = n_cand
            a0 = a0_cand
    res = [0] * n
    res[0] = a0
    return n, res


def main():
    k = int(input())
    n, res = solve(k)
    print(n)
    print(*res)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
k=int(input())
print(2)
if k%2==0:
    print(1+(k//2), 1+(k//2))
else:
    k-=1
    print(0+(k//2), 3+(k//2))

Submission status: Wrong Answer

Solution code:
n=int(input())
t=n-5;
while True:
	a=t
	b=0
	c=0
	while a>=2 or b>=2:
		if a>b:
			b+=int(a/2)
			c+=int(a/2)
			a%=2
		else:
			a+=int(b/2)
			c+=int(b/2)
			b%=2
	if c==n:
		print("2")
		print(t,0)
		exit()
	else:
		t+=1

Submission status: Wrong Answer

Solution code:
MIN_N = 2
MAX_N = 50
MAX_A0 = 10 ** 16 + 1000


def solve(k):
    n = 1
    a0 = -MAX_A0
    for n_cand in range(MIN_N, MAX_N + 1):
        a0_cand = n_cand * (k + 1) - 1
        if a0 < a0_cand <= MAX_A0:
            n = n_cand
            a0 = a0_cand
    res = [0] * n
    res[0] = a0
    return n, res


def main():
    k = int(input())
    n, res = solve(k)
    print(n)
    print(*res)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math

K, = list(map(int, sys.stdin.readline().rstrip().split()))

bias = K // 50
K = K - bias * 50

As = []
for i in range(50):
    if i < K:
        As.append(50 + 1 - i + bias * 50)
    else:
        As.append(1 + bias * 50)
print(50)
print(" ".join(map(str, As)))

exit(0)

Submission status: Wrong Answer

Solution code:
# D
K = int(input())

N = 50

L = K // 50
R = K % 50

a_list = []

if R != 0:
    for i in range(50):
        if i > 50 - R:
            a_list.append(str(150 - R + 1 + L))
        else:
            a_list.append(str(100 - R + L))
else:
    for i in range(50):
        if i == 0:
            a_list.append(str(49 + L))
        else:
            a_list.append(str(100 + L))
print(N)

print(" ".join(a_list))

Submission status: Wrong Answer

Solution code:
n=int(input())
print("2")
print(n+2,0);

Submission status: Wrong Answer

Solution code:
K = int(input())

def solve(K):
    if K == 0:
        return [3, 3, 3, 3]
    if K == 1:
        return [1, 0, 3]
    if K == 2:
        return [2, 2]
    if K % 2 == 0:
        return [K//2 + 1, K//2 + 1]
    else:
        return [K//2 - 1, K//2 + 2]

ans = solve(K)
print(len(ans))
print(*ans)

Submission status: Time Limit Exceeded

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

K = int(input())

N = 50
As = [N-1 for _ in range(N)]
ind = 0

for k in range(K):
    for i in range(N):
        As[i] -= 1
    As[ind] += N + 1
    ind += 1
    ind = ind % N
print(N)
print(*As)

Submission status: Time Limit Exceeded

Solution code:

K=int(input())

N=30
k=0
l=0
a=[N-1]*N
while True:
    #print(a)
    s=min(K-k,min(a),K)
    a[l]+=N*s
    for j in range(N):
        if j!=k:
            a[j]-=s
    l=(l+1)%N
    k+=s
    if k>=K:
        break

print(N)
print(" ".join(map(str,a)))

Submission status: Time Limit Exceeded

Solution code:
K=int(input())

N=7
k=0
l=0
a=[N-1]*N
while True:
    #print(a)
    s=min(K-k,min(a),K)
    a[l]+=N*s
    for j in range(N):
        if j!=k:
            a[j]-=s
    l=(l+1)%N
    k+=s
    if k>=K:
        break

print(N)
print(" ".join(map(str,a)))

Submission status: Accepted

Solution code:
k=int(input())
a=[i+(k+i)//50 for i in range(50)]
print(50)
print(" ".join(map(str,a)))

Submission status: Accepted

Solution code:
K = int(input())
L = 50
off, t = K//L, L-K%L
P = [L+off]*L
for i in range(t):
    P[i] += -L-1
for i in range(L):
    P[i] += t
print(L)
print(*P)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    k = int(input())
    nums = list(range(50))

    if k <= 50:
        for i in range(k):
            for j in range(50):
                if j == i:
                    nums[j] += 50
                else:
                    nums[j] -= 1
        print(50)
        print(*nums)
    else:
        q, r = divmod(k, 50)
        nums = [num + q for num in nums]
        for i in range(r):
            for j in range(50):
                if j == i:
                    nums[j] += 50
                else:
                    nums[j] -= 1
        print(50)
        print(*nums)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

k = int(input())
n = 50
x = k%n
a = k//n
ret = [a + n-x-1]*(n-x) + [a + n]*x
print(n)
print(' '.join(list(map(str,ret))))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

#k, = map(int,read().split())

def make(k):
    n = 50
    q = k//n
    r = k%n
    
    a = [(n-1)+q]*n
    for i in range(r):
        for j in range(n):
            if i==j: a[j] += n
            else: a[j] -= 1
        

    return n,a


def judge(n,a):
    if max(a) < n:
        return 0
    
    ans = 0
    for i in range(n):
        if a[i] > 3*n:
            d = (a[i]-3*n)//(n+1)
            ans += d
            a[i] -= d*(n+1)
    
    #print(ans)
    if ans >= 2*n:
        ans += n*ans    
    else:
        for i in range(n):
            a[i] += ans

    #print(ans,a)
    #return
    
    while True:
        if max(a) < n:
            return ans
        
        idx = max(range(n),key=lambda i:a[i])
        for j in range(n):
            a[j] += 1
        a[idx] -= n+1
        ans += 1
        #print(idx,a)


#n,*a = map(int,read().split())


k, = map(int,read().split())

n,a = make(k)

print(n)
print(*a)

#print(n,a)
#print(k,judge(n,a))

Submission status: Accepted

Solution code:
k = int(input())
arr = [49 + k//50 - k%50] * 50
for i in range(k%50):
    arr[i] += 50
print(50)
print(*arr)

Submission status: Accepted

Solution code:
k=int(input())
print(50)
print(*[k//50-k%50+100]*(k%50)+[k//50-k%50+49]*(50-(k%50)))

Submission status: Accepted

Solution code:
k = int(input())
a,b = k//50, k%50

base = 49+(a if not b else a+1) 
print(50)
if b==0:
    print(" ".join(map(str, [base]*50)))
else:
    i = 50 - b
    print(" ".join(map(str, [base-50+i-1]*i + [base+i]*(50-i))))

Submission status: Accepted

Solution code:
k=int(input())
x=k//50
y=k%50
ans=[i+x for i in range(50)]
for i in range(y):
  for j in range(50):
    if ans[j]==x:
      ans[j]+=50
    else:
      ans[j]-=1
for i in range(50):
  ans[i]=str(ans[i])
print(50)
print(' '.join(ans))

Submission status: Accepted

Solution code:

K = int(input())

MAX = 10**16 + 1000
N = 2
for n in range(2,51):
    SUM = n*(n-1)+K
    if 0--SUM//n > MAX:
        continue
    else:
        N = n
        break

plus = K//N
amari = K%N
A = [N-1 + plus]*N

for k in range(amari):
    for i in range(N):    
        if i==k:
            A[i] += N
        else:
            A[i] -= 1

    
print(N)
print(*A)

Submission status: Accepted

Solution code:
K=int(input())
N=50
A,B=divmod(K,N)
rs = []
print(N)
for i in range(N):
    rs.append(max((K//N+(i<B))*(N+1)+49-K, 0))
print(*rs)

Submission status: Accepted

Solution code:
K = int(input())
n = 50

ans = [n-1+n*(K//n)-(K-K//n)]*(n-K%n) + [n-1+n*(K//n+1)-(K-K//n-1)]*(K%n)
print(n)
print(*ans)

Submission status: Accepted

Solution code:
k=int(input())
n=50
r = n-1 + k//n
k %= n
res = [r for _ in range(n)]
for i in range(k):
    for j in range(n):
        if i == j:
            res[j]+= n
        else:
            res[j]-= 1

print(n)
print(" ".join(map(str,res)))

Submission status: Accepted

Solution code:
K = int(input())

q, r = divmod(K, 50)
b = q + 50

print(50)
print(*([b] * r + [b - r - 1] * (50 - r)))

Submission status: Accepted

Solution code:
# ABC068D - Decrease (Contestant ver.) (ARC079D)
def main():
    K = int(input())
    N, A, r = 50, [49 + K // 50] * 50, K % 50
    for i in range(N):
        A[i] += N - r + 1 if i < r else -r
    print(N)
    print(*A)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def getlist():
	return list(map(int, input().split()))

#受け取り
K = int(input())
N = 50
a = K // 50
b = K % 50

ans = []
for i in range(b):
	ans.append(N + N + a - b)
for i in range(N - b):
	ans.append(N - 1 + a - b)
print(N)
ans = list(map(str, ans))
print(" ".join(ans))

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    K = int(input())
    M = 10**16
    
    p = K//50
    q = K%50
    
    N = 50
    A = [49+K//50]*50
    for i in range(q):
        A[i] += 50-q+1
    for i in range(q,50):
        A[i] -= q
    
    print(N)
    print(*A)
    

main()

Submission status: Accepted

Solution code:
from datetime import date
from math import factorial
import functools
from heapq import*
from collections import deque
import collections
import math
from collections import defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


def main():
    k = int(input())
    if k == 0:
        print(3)
        print("2 2 2")
        exit()
    elif k == 1:
        print(3)
        print("1 0 3")
        exit()
    a = min(k, 50)
    b = k % a
    ans = [i + k//a for i in range(a)]
    for i in range(b):
        ans.sort()
        for j in range(1, a):
            ans[j] -= 1
        ans[0] += a

    print(a)
    print(*ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
K = int(input())
div50 = K // 50
mod50 = K % 50

print(50)
if mod50 == 0:
    print(" ".join(map(str, [div50 + 49] * 50)))
else:
    ans = []
    for i in range(50):
        base_a = div50 + 49
        if i < mod50:
            ans.append(base_a + 50 - (mod50 - 1))
        else:
            ans.append(base_a - mod50)
    print(" ".join(map(str, ans)))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *

def arc079():
    K = int(input())
    k = K//50
    a = [i+k*50 for i in range(50)]
    for i in range(K%50):
        a[i] += 51
    for i in range(50):
        a[i] -= K-k
    print(50)
    print(*a)

arc079()

Submission status: Accepted

Solution code:
from fractions import Fraction
from math import ceil, floor

# 入力
K = int(input())

# N = 50で決め打ち。操作回数がなるべく均等となるようにaを定める。
N = 50
a = [
    ceil(Fraction(K, N)) * (N + 1) + N - (K + 1)
    for _ in range(K % N)
] + [
    floor(Fraction(K, N)) * (N + 1) + N - (K + 1)
    for _ in range(N - K % N)
]
ans = '{}\n{}'.format(N, ' '.join(map(str, a)))

# 出力
print(ans)

Submission status: Accepted

Solution code:
k=int(input())
print(50)
print(' '.join(map(str,[k//50+49-k%50]*(50-k%50)+[k//50+100-k%50]*(k%50))))

Submission status: Accepted

Solution code:
k = int(input())
n = 50
tmp = k // 50
a = [49 + tmp for _ in range(n)]
k %= 50
for i in range(k):
  m = min(a)
  isp = True
  for j in range(n):
    if a[j] == m and isp:
      a[j] += n
      isp = False
    else:
      a[j] -= 1
print(n)
print(*a, sep=' ')

Submission status: Accepted

Solution code:
def counter(a,n):
    big = max(a)
    check = True
    counter = 0
    while big > n-1:
        for i in range(n):
            if a[i] == big and check:
                check = False
                a[i] -= n
            else:
                a[i] += 1
        counter += 1
        big = max(a)
        check = True
    return counter

k = int(input())
n = 50
print(n)
temp = k//50
a = [49+temp for i in range(n)]
k = k - 50*(k//50)
for i in range(k):
    big = min(a)
    check = True
    for j in range(n):
        if a[j] == big and check:
            check = False
            a[j] += 50
        else:
            a[j] -= 1
for i in range(n):
    if i != n-1:
        print(a[i],end = " ")
    else:
        print(a[i])

Submission status: Accepted

Solution code:
k = int(input())

n = 50

a = k//n
b = k%n

if b == 0:
    res = [a]*n
    for i in range(n):
        res[i] += i
else:
    res = [0]*(n+1)
    for i in range(n+1):
        res[i] = i
    del res[n-b]
    for i in range(n):
        res[i]+=a
print(n)
ass = ''
for i in range(n):
    if i != 0:
        ass += ' '
    ass += str(res[i])
print(ass)

Submission status: Accepted

Solution code:
K = int(input())
ans = [K//50 + i for i in range(50)]
if K%50:
  for i in range(K%50):
    ans[i] += 51
    ans = [a-1 for a in ans]
print(50)
ans = [str(a) for a in ans]
print(" ".join(ans))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# N = 50で固定して考える
# K = 151のとき、左端で3回、それ以外で2回取れるようにするのを目標にする
# すると、左端には、98回の増加があり
# それ以外には99回の増加があることがわかる
# これを加味して初期の値を決めればよい

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys
import numpy as np

def solve_d(k):
    if k == 0:
        return [0] * 50

    if k <= 50:
        arr = []
        for i in range(k):
            arr.append(50 - i)
        for i in range(k, 50):
            arr.append(0)
        return arr
    else:
        arr = list(reversed(range(1, 51)))
        base = (k - 1) // 50
        for i in range(50):
            arr[i] += base - 1
        for i in range(k - base * 50):
            arr[i] += 1
        return arr

K = int(input())
print(50)
print(*solve_d(K))


##################
# 以下、デバッグ用
##################

# 問題Eのコード
def solve_e(As):
    ans = 0
    N = len(As)
    As = As[:]
    while True:
        taken = [0] * N
        for i, a in enumerate(As):
            taken[i] = a // N
            As[i] -= taken[i] * N
        taken_sum = sum(taken)
        if taken_sum == 0:
            break
        ans += taken_sum
        for i in range(N):
            As[i] += (taken_sum - taken[i])
    return ans

# # 検算(E問題の結果を使う)
# for k in range(1000):
#     arr = solve_d(k)
#     arr_copied = arr.copy()
#     res = solve_e(arr_copied)
#     print("====\nk = ", k)
#     print("arr: ", arr)
#     if res != k:
#         print("error! res = ", res)
#         break

Submission status: Accepted

Solution code:
K=int(input())

i=K//50
j=K%50

ans = []

for k in range(j):
    ans.append(100+i-j)
for k in range(50-j):
    ans.append(50+i-1-j)

print(50)
print(*ans)

Submission status: Accepted

Solution code:
K=int(input())
print(50)
a,b=K//50,K%50
ans=[]
for i in range(50-b):
  ans.append(str(a+i))
  
for i in range(b):
  ans.append(str(a+50-b+i+1))
  
print(" ".join(ans))

Submission status: Accepted

Solution code:
K = int(input())

a = K//50
b = K %50
Ans = [100+a-b]*b + [49+a-b]*(50-b)
print(50)
print(*Ans)

Submission status: Accepted

Solution code:
import sys
K = int(input())

a = K//50
b = K %50
if K == 0:
    print(2)
    print(0, 0)
    sys.exit()

Ans = [100+a-b]*b + [49+a-b]*(50-b)
print(50)
print(*Ans)

Submission status: Accepted

Solution code:
k = int(input())
n = 50
print(n)

l = []
for i in range(n):
    tmp = [n+1-i]*i + [-i]*(n-i)
    l.append(tmp)

res = []
for i in range(n):
    res.append(k//n + i + l[k%n][i])
print(*res)

"""
for s in l:
    print(*s)
"""

Submission status: Accepted

Solution code:
K = int(input())
N = 50
if K <= N:
    ans = [N]*K + [0]*(N-K)
    print(N)
    print(*ans)
    exit()

ans = list(range(N,0,-1))
d,m = divmod(K,N)
for i in range(N):
    ans[i] += d-1 + int(i < m)

print(N)
print(*ans)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

k = ni()

n = 50
a = [i for i in range(n)]

for i in range(n):
    a[i] += (k//n)
    
for i in range(k%n):
    a[i] += n
    for j in range(n):
        if i != j:
            a[j] -= 1
            
print(n)
print(*a)

Submission status: Accepted

Solution code:
K = int(input())
N = 50
a = [0] * 50

if K <= 50:
    for i in range(K):
        a[i] = 50
else:
    m = (K - 1) // 50
    base = 100 + m
    r = K % 50
    big = base - r
    small = big - 50 - r

    for i in range(r):
        a[i] = big
    for i in range(r, N, 1):
        a[i] = small

print(N)
print(" ".join(map(str, a)))

Submission status: Accepted

Solution code:
k = int(input())
if k == 0:
	print(2)
	print("1 1")
elif k == 1:
	print(2)
	print("2 0")
elif k <= 50:
	print(k)
	print(*[k for _ in range(k)])
else:
	print(50)
	div = k // 50 - 1
	mod = k % 50
	if mod == 0:
		ans = [50 + div] * 50
		print(*ans)
	else:
		ans = [50 + div + 50 - (mod - 1)] * mod + [50 + div - mod] * (50 - mod)
		print(*ans)

Submission status: Accepted

Solution code:
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import bisect
 
def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

K = read()

N = 50
print(N)
q, r = divmod(K, N)
ans = [q + 2 * N - r] * r + [q + N-1 - r] * (N - r)
print(' '.join(str(a) for a in ans))

Submission status: Accepted

Solution code:
K=int(input())
Q=K//50
R=K%50
ans=[49+Q]*50
for i in range(50):
    if i<50-R:
        ans[i]-=R
    else:
        ans[i]+=50-R+1
print(50)
print(' '.join(map(str,ans)))

Submission status: Accepted

Solution code:
K=int(input())
N=50

def solve(A,cnt):
  res=len(A)
  for i in range(cnt):
    A[i]+=(res+1)
    for j in range(res):
      A[j]-=1
  return A

Ans=[0 for x in range(N)]
Ans[0]=25+(K//50)
for i in range(1,N):
  if i % 2 ==0:
    Ans[i]=Ans[i-1]+1
  else:
    Ans[i]=Ans[i-1]

Ans=solve(Ans,K%50)

print(N)
for i in range(N):
  if i == N-1:
    print(Ans[i])
  else:
    print(Ans[i],end=" ")

Submission status: Accepted

Solution code:
k = int(input())
n = 50
p = k // n
a = [i + p for i in range(n)]
m = k % n
for i in range(n) :
        if i < m : a[i] += n - (m - 1)
        else :     a[i] -= m
print(n)
print(*a)

Submission status: Accepted

Solution code:
k = int(input())
n = 50
p = k // n
a = [i + p for i in range(n)]
m = k % n
for i in range(m) :
    a[i] += n
    for j in range(n) :
        if i != j :
            a[j] -= 1
print(n)
print(*a)

Submission status: Accepted

Solution code:
k = int(input())
n = 50
m = k % n
q = k // n

a = [q + n - m - 1] * n
for i in range(m):
    a[n - 1 - i] += n+1

print(n)
print(*a)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
K = int(input())

N = 50
As = [N-1 for _ in range(N)]
ind = 0

modk = K % 50
base = 49 + K//50 - modk

ans = []

if modk != 0:
    for i in range(N):
        if i >= N - modk:
            ans.append(base + N + 1)
        else:
            ans.append(base)
    # for i in range(0,modk,1):
    #     ans.append(base + N + 1)
    # for i in range(modk,N,1):
    #     ans.append(base)
else:
    for i in range(N):
        ans.append(49 + K//50)
# for k in range(K):
#     for i in range(N):
#         As[i] -= 1
#     As[ind] += N + 1
#     ind += 1
#     ind = ind % N
# print(N)
# print(*As)
print(N)
print(*ans)