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

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

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):



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))))

Solution (Python):


import sys
read = sys.stdin.read
readline = sys.stdin.readline



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)
    
    
    if ans >= 2*n:
        ans += n*ans    
    else:
        for i in range(n):
            a[i] += ans

    
    
    
    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
        





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

n,a = make(k)

print(n)
print(*a)

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

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

Solution (Python):
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))))

Solution (Python):
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))

Solution (Python):

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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)))

Solution (Python):
K = int(input())

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

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

Solution (Python):

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()

Solution (Python):
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))

Solution (Python):
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()

Solution (Python):
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()

Solution (Python):
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)))

Solution (Python):
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()

Solution (Python):
from fractions import Fraction
from math import ceil, floor


K = int(input())


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)

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

Solution (Python):
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=' ')

Solution (Python):
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])

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):









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))







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

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
K = int(input())

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

Solution (Python):
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)

Solution (Python):
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)
"""

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)))

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)))

Solution (Python):
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=" ")

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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)
    
    
    
    
else:
    for i in range(N):
        ans.append(49 + K//50)








print(N)
print(*ans)

Solution (Python):

import math
K = int(input())

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

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

ans = []

if modk != 0:
    for i in range(N):
        if i >= N - modk:
            ans.append(base + N + 1)
        else:
            ans.append(base)
    
    
    
    
else:
    for i in range(N):
        ans.append(49 + L)








print(N)
print(*ans)

Solution (Python):
k = int(input())

if k == 0:
    print("2\n1 1")
    exit(0)

if k == 1:
    print("2\n2 0")
    exit(0)

n = min(50,k)
a = [i for i in range(n)]
c = k // n

for i in range(n):
    a[i] += c

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

print(n)
for i in a:
    print(i, end=' ')
print()

Solution (Python):
if __name__ == "__main__":
    K = int(input())
    N = 50
    result = list(range(N))
    for x in range(N):
        result[x] += K // N
    K %= N

    for x in range(K):
        result[x] += N + 1
        for i in range(N):
            result[i] -= 1
    print (len(result))
    print (" ".join(map(str, result)))

Solution (Python):
k = input()
epoch = k / 50
tweak = 50 - k % 50

ans = [50 + epoch for _ in range(50)]
for i in range(50):
    if i < tweak:
        ans[i] += -50 + tweak - 1
    else:
        ans[i] += tweak

ans_st = " ".join(map(str, ans))
print 50
print ans_st

Solution (Python):
K = int(input())

b = K % 50
a = K // 50
	
list = [0] * 50
j = 0

while (j <= 49 - b) :
	list[j] = 49 + a - b
	j += 1

while (j <= 49):
	list[j] = 2 * 50 + a - b
	j += 1

list = map(str, list)
print('50')
print(' '.join(list))

Solution (Python):
k = int(input())
d, m = divmod(k, 50)
b = 49 + d
print(50)
print(*map(str, [b + 1] * m + [b - m] * (50 - m)))

Solution (Python):
b=int(input());a=b//50+49;b%=50;c=50-b;print(50,*[a-b]*c+[a+c]*b)

Solution (Python):
b=input();a=b/50+49;b%=50;c=50-b;print 50,(`a-b`+" ")*c+(`a+c`+" ")*b

Solution (Python):
b=input();a=b/50+49;b%=50;c=50-b;print"50\n"+(`a-b`+" ")*c+(`a+c`+" ")*b

Solution (Python):
k = input()
n = 50
print n
a = (k / 50) + n-1
b = k % 50
print " ".join(map(str, [a - b]*(n-b) + [a + (n-b)]*b))

Solution (Python):
if __name__ == '__main__':
    K = int(input())
    N = 50
    ans = [i for i in range(0, N)]

    modulo = K % N
    for i in range(0, modulo):
        ans[i] += N
        for j in range(0, N):
            if i != j:
                ans[j] -= 1

    divide = K // N

    ans = [str(divide + i) for i in ans]
    print(N)
    print(" ".join(ans))

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

base = K // N
resi = K % N

A = [49 + base] * N

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

print(N)
print(' '.join(map(str,A)))

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

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

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

Solution (Python):
import sys
k=int(raw_input())
n=k

if n<50:
    if n%2==0:
        print 2
        print "%d %d" %( n/2+1,n/2+1)
    else:
        print 2
        print "%d %d" % ((n-1)/2,(n-1)/2+3)
    sys.exit(0)


def proc(ls):
    ls.sort()
    ls[-1]-=len(ls)
    for i in range(len(ls)-1):
        ls[i]+=1
    return ls
if k%5==0:
    print 50
    ans= [k/50+49]*50
    for i in range(49):
        sys.stdout.write(str(ans[i])+" ")
    sys.stdout.write(str(ans[49]))
    sys.stdout.write("\n")
else:
    print 50
    k+=50
    ans=[k/50+49]*50
    for i in range(50-k%50):
        ans=proc(ans)
    for i in range(49):
        sys.stdout.write(str(ans[i])+" ")
    sys.stdout.write(str(ans[49]))
    sys.stdout.write("\n")

Solution (Python):

import numpy as np

K = int(input())

a = np.ones(50).astype(np.int64)*(49) + (K)//50


if K%50 != 0:
    a[:K%50] += 51 - (K%50)
    a[K%50:] -= (K%50)
else:
    pass
                
result = "50\n{}".format(a[0])
for a_ in a[1:]:
    result += (" {}".format(int(a_)))
print(result)

Solution (Python):
import sys
state_size = 50

init = [0] + [state_size - 1] * (state_size - 1)
states = [init]
for i in xrange(1,state_size):
    topush = []
    for j in xrange(state_size):
        if i-1 == j:
            topush.append(states[-1][j] + state_size)
        else:
            topush.append(states[-1][j] - 1)
    states.append(topush)

K = int(sys.stdin.readline())

P = K/state_size
Q = K%state_size

ret = states[Q]
ret = [x+P for x in ret]

print state_size
print ' '.join(map(str,ret))

Solution (Python):
k=int(input())
n=50
q,r=k//n,k%n
a=[n-1-k+q*(n+1)]*n
a=list(map(lambda x:x+n+1,a[:r]))+a[r:n]
print(n)
print(' '.join(map(str,a)))

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

    if k == 0:
        print(4)
        print(3, 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 = [50+k//50-k%50-1]*50
    for i in range(k%50):
        res[i] += 51
    print(' '.join([str(i) for i in res]))

if __name__ == '__main__':
    main()

Solution (Python):
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, K//2 + 3]
    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)

Solution (Python):
K = int(input())

n = 50

b = K // n

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

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

Solution (Python):
k = int(raw_input())
n = 50

ai = k/n + (n-1)
a = [ai] * n
r = k%n
b = n - r + 1
cq = (b * r) / (n-r)
cr = (b * r) % (n-r)
for i in range(n):
  if i < r:
    a[i] += b
  else:
    a[i] -= cq
    if cr > 0:
      a[i] -= 1
      cr -= 1

a = map(str, a)

print n
print " ".join(a)

Solution (Python):
K = int(input())

N = 50
a = [0] * N

m = K // N
mod = K % N

for i in range(0, mod):
    a[i] = N * (m + 2) - K + m

for i in range(mod, N):
    if m != 0:
        a[i] = N * (m + 1) - K + m - 1

print(N)
print(' '.join([str(x) for x in a]))

Solution (Python):
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)
    ok = 49 + mn
    for i in range(50):
        if i < md:
            print(ok + 50 - (md - 1), end=" ")
        else:
            print(ok - md, end= " ")

Solution (Python):
x = int(input())
if x == 0:
    print(4)
    print(3, 3, 3, 3)
    exit()

x-= 1
phase = x//50
subphase = x%50
pstart = phase*50

left = 99+phase-(x-pstart)
right = 48+phase-(x-pstart)
ans = [left]*(1+subphase)+[right]*(49-subphase)
print(50)
print(*ans)

Solution (Python):

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):
    N = 50
    a = [49] * N
    div, mod = divmod(K, N)
    for i in range(N):
        a[i] += div
    if mod != 0:
        for i in range(mod):
            a[i] += N - (mod - 1)
        for i in range(mod, N):
            a[i] += -mod

    ans = "50\n" + " ".join(map(str, a))

    return ans


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


if __name__ == "__main__":
    main()

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

q,r = K//N, K%N

A = [N-1-K + q*(N+1)]*N

for i in range(r):
  A[i] += N+1

print(N)
print(' '.join(map(str,A)))

Solution (Python):
K = int(input())
N = 50
a = K // N
b = K % N

l = a-b+N*2
m = a-b+N-1
L = [l for _ in range(b)]
M = [m for _ in range(N-b)]

print(N)
print(" ".join(map(str, L+M)))

Solution (Python):
k = int(input())
if k % 50 == 0:
    ans = [50 + (k // 50) - 1] * 50
else:
    mm = k % 50
    base = 50 + 50 - mm
    k -= mm
    k = k // 50
    lul = 50 - mm - 1 + k
    k += base
    ans = [k] * mm + [lul] * (50 - mm)

print(50)
print(' '.join([str(x) for x in ans]))

Solution (Python):
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] + m + 1,
    for i in xrange(l, n):
        print ans[i] + 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)

Solution (Python):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(a): return "".join(list(map(str, a)))
def plis(a): return " ".join(list(map(str, a)))

K = ri()
X = K // 50
mod = K % 50
a = [49 - mod + X for i in range(50)]
for i in range(mod):
    a[i] += 51
print(50)
print(plis(a))

Solution (Python):


import sys
import math

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

N = 50

As = [0 for _ in range(50)]
if K > 50:
    bias = K // 50
    K = K - bias * 50


    
    
    
    
    if bias > 0:
        for i in range(50):
            As[i] += (50 - i + bias -1 )

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

exit(0)

Solution (Python):
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(n)
print(' '.join(map(str, a)))

Solution (Python):
K = int(input())
L = 50
N = K // L + L - 1
res = K - (N - L + 1) * L
assert(res < 50)
ans = [N] * L
for i in range(res):
    ans[i] += L - res + 1
for i in range(res, L):
    ans[i] -= res
print(L)
print(*ans)

Solution (Python):
def main():
    K = int(input())
    a = [K//50 + 49] * 50
    kp = K % 50
    for i in range(50):
        if i < kp:
            a[i] += 51 - kp
        else:
            a[i] -= kp
    print(50)
    print(" ".join(map(str, a)))

main()

Solution (Python):
K = int(input())


def check(lst):
    for i in range(K):
        maxv = max(lst)
        if maxv <= N - 1:
            return False
        flg = False
        for j in range(N):
            if lst[j] == maxv and not flg:
                lst[j] -= N
                flg = True
            else:
                lst[j] += 1

    for i in range(N):
        if lst[i] >= N:
            return False
    return True



N = 50
mod = K % N
ans = []
for i in range(N):
    if i < mod:
        ans.append(N - i)
    else:
        ans.append(N - mod - 1)

for i in range(N):
    if i < mod:
        ans[i] = ans[i] + K // N + 1
    else:
        ans[i] = ans[i] + K // N
print(N)
print(" ".join(map(str, ans)))

Solution (Python):
import sys




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


def read_int():
    return int(input())


def read_str_list():
    return input().split()


def read_str():
    return input()


def solve():
    k = read_int()
    n = 50
    q, r = divmod(k, n)
    a = [n - 1 + q] * n
    for i in range(r):
        a[i] += n - r + 1
    for i in range(r, n):
        a[i] += -r
    return n, a


def main():
    n, a = solve()
    print(n)
    print(*a)


if __name__ == '__main__':
    main()

Solution (Python):


def main():
  N = 50
  K = int(raw_input())
  A = [N - 1 + (K / N)] * N
  K %= N
  for i in xrange(K):
    for j in xrange(N):
      A[j] -= 1
    A[i] += N + 1
  print N
  print ' '.join(map(str, A))

main()

Solution (Python):
k = int(input())
n = 50
d = k // n
a = [d + i for i in range(n)]  
k = k % n
for i in range(k):
    a[i] += n
    for j in range(n):
        if j != i:
            a[j] -= 1
print(n)
print(' '.join(map(str, a)))

Solution (Python):
k = int(raw_input())

n = 50
a = [n - 1 + k // n] * n
j = 0
s = 0
c = 0
for i in xrange(k % n):
    a[j] += n + 1
    s += 1
    c += 1
    if c == 15:
        j += 1
        c = 0
for i in xrange(n):
    a[i] -= s
print n
print " ".join(str(x) for x in a)

Solution (Python):

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(99 - R + 1 + L))
        else:
            a_list.append(str(49 - R + L))
else:
    for i in range(50):
        a_list.append(str(49 + L))
        
print(len(a_list))
print(" ".join(a_list))

Solution (Python):
k = int(raw_input())
n = 50
a = [49] * n
c = k // n
for i in range(n):
	a[i] += c
c = k % n
for _ in range(c):
	mp = 0
	for i in range(n):
		if a[i] < a[mp]:
			mp = i
	for i in range(n):
		if i == mp:
			a[i] += n
		else:
			a[i] -= 1
print n
for i in range(n):
	print a[i],

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
gosa = 1.0 / 10**9
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    K = I()
    N = 50
    a = [49] * 50
    k = K // 50
    kp = K % 50
    for i in range(N):
        t = k
        if i < kp:
            t += 1
        for j in range(N):
            if i == j:
                continue
            a[j] -= t
        a[i] += t * 50
    return '{}\n{}'.format(N, ' '.join(map(str,a)))



print(main())