package Codeforces542Division1;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class B542 {

    private final static Integer N = 2000;
//    private final static Integer N = 5;
    private final static Integer MAX_VAL = 1000000;

    public static void main(String[] args) throws FileNotFoundException {
//        final File inFile = new File("resources/B542.in");
//        final Scanner scanner = new Scanner(inFile);
        final Scanner scanner = new Scanner(System.in);

        final Integer K = scanner.nextInt();
        Integer S = K + N - 1;

        System.out.println(N);
        System.out.print("-1 ");
        S += 1;
        for (int i = 1 ; i < N ; i++) {
            if((N - i - 1) > 0 && (N - i - 1) > S) {
                System.out.print("1 ");
                S -= 1;
            } else if((S - (N - i - 1)) < MAX_VAL) {
                System.out.print((S - (N - i - 1)) + " ");
                S = (N - i - 1);
            } else {
                System.out.print(MAX_VAL + " ");
                S -= MAX_VAL;
            }
        }
        System.out.print("\n");
    }
}


//package Codeforces542Division1;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class B542 {

    private final static Integer N = 2000;
//    private final static Integer N = 5;
    private final static Integer MAX_VAL = 1000000;

    public static void main(String[] args) throws FileNotFoundException {
//        final File inFile = new File("resources/B542.in");
//        final Scanner scanner = new Scanner(inFile);
        final Scanner scanner = new Scanner(System.in);

        final Integer K = scanner.nextInt();
        Integer S = K + N - 1;

        System.out.println(N);
        System.out.print("-1 ");
        S += 1;
        for (int i = 1 ; i < N ; i++) {
            if((N - i - 1) > 0 && (N - i - 1) > S) {
                System.out.print("1 ");
                S -= 1;
            } else if((S - (N - i - 1)) < MAX_VAL) {
                System.out.print((S - (N - i - 1)) + " ");
                S = (N - i - 1);
            } else {
                System.out.print(MAX_VAL + " ");
                S -= MAX_VAL;
            }
        }
        System.out.print("\n");
    }
}


import java.util.Scanner;

/*

-1 -1 -1 -1 -1 -1 -1 -1 -1 x

(x-1) * 2000 - x*1999

x-2000=k

x=k+2000

1500x-1000000
 */
public class b {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int k = in.nextInt();

		System.out.println(2000);
		System.out.println(-1);
		System.out.println(2000);
		for(int i=0;i<2000-2;i++) {
			int v = Math.min(k, 1000000);
			System.out.println(v);
			k -= v;
		}
	}
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package Round542;

import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author Hemant Dhanuka
 */
public class E {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);

        int k=s.nextInt();
        int n=2000;  //assumed int for all ansewers
        int a[]=new int[n];
        Arrays.fill(a,1);
        a[0]=-1;

        int rem=1+k;
        for(int i=1;i<n;i++){

            int picked=Math.min(rem, 1000000-1);

            rem=rem-picked;
            a[i]=a[i]+picked;

        }
        //for me always it will give right answer
     //   System.out.println(rem);
        System.out.println(n);
        for(int ans:a){
            System.out.print(ans+" ");
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author Hieu Le
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskB {
    private static final int MAX = (int) 1e6;
    private static final int N = 2000;
    private List<Integer> primes;

    public TaskB() {
      primes = new ArrayList<>();
      boolean[] sieve = sieve(N);
      for (int i = 2; i <= N; ++i) if (sieve[i]) primes.add(i);
    }

    public static boolean[] sieve(int maxValue) {
      boolean[] isPrime = new boolean[maxValue + 1];
      Arrays.fill(isPrime, true);
      isPrime[0] = isPrime[1] = false;
      int limit = (int) Math.sqrt(maxValue);
      for (int i = 2; i <= limit; ++i) {
        if (isPrime[i]) {
          for (int j = i; i * j <= maxValue; ++j) isPrime[i * j] = false;
        }
      }
      return isPrime;
    }

    private int naive(int[] a) {
      int res = 0, cur = 0, k = -1;
      for (int i = 0; i < a.length; ++i) {
        cur += a[i];
        if (cur < 0) {
          cur = 0;
          k = i;
        }
        res = Math.max(res, (i - k) * cur);
      }
      return res;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int k = in.nextInt();

      for (int b = 1; b <= MAX; ++b) {
        int sum = b + k;
        int min = sum / b;
        for (int n = min + 1; n <= Math.min(sum, N); ++n) {
          if (sum % n == 0) {
            int delta = sum / n;
            if (b > delta) {
              out.println(n);
              for (int i = 0; i < n - 2; ++i) out.print("0 ");
              int a = -(b - delta);
              out.printf("%d %d\n", a, b);
              int[] arr = new int[n];
              arr[n - 2] = a;
              arr[n - 1] = b;

              if (naive(arr) + k != sum) {
                throw new RuntimeException();
              }
              return;
            }
          }
        }
      }

      out.println(-1);
    }
  }

  static class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private static final int BUFFER_SIZE = 32768;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), BUFFER_SIZE);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author ilyakor
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    OutputWriter out = new OutputWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskB {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
      // Random random = new Random(0xdead);
      // for (int t = 1000 * 1000 * 1000 - 100000; t < 1000 * 1000 * 1000; ++t)
      //     // doSolve(random.nextInt(1000 * 1000 * 1000) + 1);
      //     doSolve(t);
      int k = in.nextInt();
      TaskB.Res res = doSolve(k);
      out.printLine(res.len + 4);
      for (int i = 0; i < res.len - 2; ++i) {
        out.print("0 ");
      }
      out.print("-1 ");
      out.print(res.x + " ");
      out.print("-1000000 ");
      out.print("-1000000 ");
      out.print("-1000000 ");
      out.printLine(res.y);
    }

    TaskB.Res doSolve(int delta) {
      for (int len = 2; len <= 2000; ++len) {
        if ((delta + len) / (len + 1) >= 1000 * 1000 - 10) {
          continue;
        }
        for (int y = 0; y < 1000; ++y) {
          int val = delta + len + y;
          if (val % (len - 1) != 0) {
            continue;
          }
          val /= len - 1;
          if (val > 1000 * 1000) {
            continue;
          }
          if (val + y > 1000 * 1000) {
            continue;
          }
          return new TaskB.Res(len, val, val + y);
        }
      }
      throw new RuntimeException();
    }

    static class Res {

      int len;
      int x;
      int y;

      public Res(int len, int x, int y) {
        this.len = len;
        this.x = x;
        this.y = y;
      }

    }

  }

  static class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
      writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
      this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
      for (int i = 0; i < objects.length; i++) {
        if (i != 0) {
          writer.print(' ');
        }
        writer.print(objects[i]);
      }
    }

    public void printLine(Object... objects) {
      print(objects);
      writer.println();
    }

    public void close() {
      writer.close();
    }

  }

  static class InputReader {

    private InputStream stream;
    private byte[] buffer = new byte[10000];
    private int cur;
    private int count;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public static boolean isSpace(int c) {
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public int read() {
      if (count == -1) {
        throw new InputMismatchException();
      }
      try {
        if (cur >= count) {
          cur = 0;
          count = stream.read(buffer);
          if (count <= 0) {
            return -1;
          }
        }
      } catch (IOException e) {
        throw new InputMismatchException();
      }
      return buffer[cur++];
    }

    public int readSkipSpace() {
      int c;
      do {
        c = read();
      } while (isSpace(c));
      return c;
    }

    public int nextInt() {
      int sgn = 1;
      int c = readSkipSpace();
      if (c == '-') {
        sgn = -1;
        c = read();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9') {
          throw new InputMismatchException();
        }
        res = res * 10 + c - '0';
        c = read();
      } while (!isSpace(c));
      res *= sgn;
      return res;
    }

  }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ijxjdjd
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int K = in.nextInt();
            int b = K + 2000;
            int[] res = new int[2000];
            res[0] = -1;
            for (int i = 1; i < 2000; i++) {
                if (b == 0) {
                    break;
                } else {
                    if (b > 1000000) {
                        b -= 1000000;
                        res[i] = 1000000;
                    } else {
                        res[i] = b;
                        b = 0;
                    }
                }
            }
            out.println(2000);
            for (int val : res) {
                out.print(val + " ");
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int k = scanner.nextInt();
    int s = k + 2000;
    System.out.println(2000);

    System.out.print("-1 ");
    System.out.print(s - 1998 * (s / 1999) + " ");

    for (int i = 2; i < 2000; i++) {
      System.out.print(s / 1999 + " ");
    }

    System.out.println("");
  }
}


import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int k = scanner.nextInt();
    int s = k + 2000;
    System.out.println(2000);

    System.out.print("-1 ");
    System.out.print(s - 1998 * (s / 1999) + " ");

    for (int i = 2; i < 2000; i++) {
      System.out.print(s / 1999);
    }

    System.out.println("");
  }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class B {
	public static void main(String[] args) throws IOException {

		/**/
		Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		/*/
		Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream("src/b.in"))));
		/**/

		int k = sc.nextInt();
		int n = 2000;
		int xmy = k/n+493;
		int x = xmy*n-k;
		int y = x-xmy;
		System.out.println(n);
		StringBuilder tp = new StringBuilder();
		String sp = "";
		for (int i = 0; i < n-2; i++) {
			tp.append(sp+0);
			sp = " ";
		}
		tp.append(sp+-y);
		tp.append(sp+x);
		System.out.println(tp);
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author Hieu Le
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskB {
    private static final int MAX = (int) 1e6;
    private static final int N = 2000;
    private List<Integer> primes;

    public TaskB() {
      primes = new ArrayList<>();
      boolean[] sieve = sieve(N);
      for (int i = 2; i <= N; ++i) if (sieve[i]) primes.add(i);
    }

    public static boolean[] sieve(int maxValue) {
      boolean[] isPrime = new boolean[maxValue + 1];
      Arrays.fill(isPrime, true);
      isPrime[0] = isPrime[1] = false;
      int limit = (int) Math.sqrt(maxValue);
      for (int i = 2; i <= limit; ++i) {
        if (isPrime[i]) {
          for (int j = i; i * j <= maxValue; ++j) isPrime[i * j] = false;
        }
      }
      return isPrime;
    }

    private int naive(int[] a) {
      int res = 0, cur = 0, k = -1;
      for (int i = 0; i < a.length; ++i) {
        cur += a[i];
        if (cur < 0) {
          cur = 0;
          k = i;
        }
        res = Math.max(res, (i - k) * cur);
      }
      return res;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int k = in.nextInt();

      for (int b = 1; b <= MAX; ++b) {
        int sum = b + k;
        int min = sum / b;
        for (int n = min + 1; n <= Math.min(sum, MAX); ++n) {
          if (sum % n == 0) {
            int delta = sum / n;
            if (b > delta) {
              out.println(n);
              for (int i = 0; i < n - 2; ++i) out.print("0 ");
              int a = -(b - delta);
              out.printf("%d %d\n", a, b);
              int[] arr = new int[n];
              arr[n - 2] = a;
              arr[n - 1] = b;

              if (naive(arr) + k != sum) {
                throw new RuntimeException();
              }
              return;
            }
          }
        }
      }

      throw new RuntimeException();
    }
  }

  static class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private static final int BUFFER_SIZE = 32768;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), BUFFER_SIZE);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author Hieu Le
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskB {
    private static final int MAX = (int) 1e6;
    private static final int N = 2000;
    private List<Integer> primes;

    public TaskB() {
      primes = new ArrayList<>();
      boolean[] sieve = sieve(N);
      for (int i = 2; i <= N; ++i) if (sieve[i]) primes.add(i);
    }

    public static boolean[] sieve(int maxValue) {
      boolean[] isPrime = new boolean[maxValue + 1];
      Arrays.fill(isPrime, true);
      isPrime[0] = isPrime[1] = false;
      int limit = (int) Math.sqrt(maxValue);
      for (int i = 2; i <= limit; ++i) {
        if (isPrime[i]) {
          for (int j = i; i * j <= maxValue; ++j) isPrime[i * j] = false;
        }
      }
      return isPrime;
    }

    private int naive(int[] a) {
      int res = 0, cur = 0, k = -1;
      for (int i = 0; i < a.length; ++i) {
        cur += a[i];
        if (cur < 0) {
          cur = 0;
          k = i;
        }
        res = Math.max(res, (i - k) * cur);
      }
      return res;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int k = in.nextInt();

      for (int b = 1; b <= MAX; ++b) {
        int sum = b + k;
        int min = sum / b;
        for (int n = min + 1; n <= Math.min(sum, MAX); ++n) {
          if (sum % n == 0) {
            int delta = sum / n;
            if (b > delta) {
              out.println(n);
              for (int i = 0; i < n - 2; ++i) out.print("0 ");
              int a = -(b - delta);
              out.printf("%d %d\n", a, b);
              int[] arr = new int[n];
              arr[n - 2] = a;
              arr[n - 1] = b;

              if (naive(arr) + k != sum) {
                throw new RuntimeException();
              }
              return;
            }
          }
        }
      }

      out.println(-1);
    }
  }

  static class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;
    private static final int BUFFER_SIZE = 32768;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), BUFFER_SIZE);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}


import java.io.*;

public class CF1129B {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int k = Integer.parseInt(br.readLine());
		int n = 2000;
		int x = (n - 1) - k % (n - 1);
		int y = (k + x) / (n - 1) + x;
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < n - 2; i++)
			sb.append("0 ");
		sb.append(-x + " " + y);
		System.out.println(n);
		System.out.println(sb);
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int k = in.nextInt();
            if (k <= 1000000 - 2) {
                out.println(2);
                out.println(-1 + " " + (k + 2));
                return;
            }

            for (int BASE = 999990; ; ++BASE) {

                int num = (k + BASE - 2) / (BASE - 1);

                int rem = 0;
                while (true) {
                    rem = (BASE - 1) * num - k;
                    if (rem <= BASE || num < 2) {
                        ++num;
                    } else {
                        break;
                    }
                }

                if (rem % 3 != 0) {
                    ++num;
                    rem = (BASE - 1) * num - k;
                }
                if (rem % 3 != 0) continue;

                List<Integer> list = new ArrayList<>();
                for (int i = 0; i < num - 2; ++i) {
                    list.add(0);
                }
                list.add(-1);
                list.add(BASE);
                for (int i = 0; i < 10; ++i) {
                    list.add(-BASE);
                }
                list.add(0);
                list.add(0);
                list.add(rem / 3);

                out.println(list.size());
                for (int i = 0; i < list.size(); ++i) {
                    if (i > 0) out.print(" ");
                    out.print(list.get(i));
                }
                out.println();
                return;
            }

        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new UnknownError();
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int k = in.nextInt();
            if (k <= 1000000 - 2) {
                out.println(2);
                out.println(-1 + " " + (k + 2));
                return;
            }

            for (int BASE = 800000; ; ++BASE) {

                int num = (k + BASE - 2) / (BASE - 1);

                int rem = 0;
                while (true) {
                    rem = (BASE - 1) * num - k;
                    if (rem <= BASE || num < 2) {
                        ++num;
                    } else {
                        break;
                    }
                }

                if (rem % 2 != 0) continue;

                List<Integer> list = new ArrayList<>();
                for (int i = 0; i < num - 2; ++i) {
                    list.add(0);
                }
                list.add(-1);
                list.add(BASE);
                for (int i = 0; i < 10; ++i) {
                    list.add(-BASE);
                }
                list.add(1);
                list.add(rem / 2 - 1);

                out.println(list.size());
                for (int i = 0; i < list.size(); ++i) {
                    if (i > 0) out.print(" ");
                    out.print(list.get(i));
                }
                out.println();
                return;
            }

        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new UnknownError();
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        private static final int BASE = 100000;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int k = in.nextInt();

            int num = (k + BASE - 2) / (BASE - 1);

            int rem = 0;
            while (true) {
                rem = (BASE - 1) * num - k;
                if (rem <= BASE || num < 2) {
                    ++num;
                } else {
                    break;
                }
            }

            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < num - 2; ++i) {
                list.add(0);
            }
            list.add(-1);
            list.add(BASE);
            for (int i = 0; i < 10; ++i) {
                list.add(-BASE);
            }
            list.add(rem);

            for (int i = 0; i < list.size(); ++i) {
                if (i > 0) out.print(" ");
                out.print(list.get(i));
            }
            out.println();

        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new UnknownError();
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int k = in.nextInt();
            if (k <= 1000000 - 2) {
                out.println(2);
                out.println(-1 + " " + (k + 2));
                return;
            }

            for (int BASE = 511050; ; ++BASE) {

                int num = (k + BASE - 2) / (BASE - 1);

                int rem = 0;
                while (true) {
                    rem = (BASE - 1) * num - k;
                    if (rem <= BASE || num < 2) {
                        ++num;
                    } else {
                        break;
                    }
                }

                if (rem % 2 != 0) continue;

                List<Integer> list = new ArrayList<>();
                for (int i = 0; i < num - 2; ++i) {
                    list.add(0);
                }
                list.add(-1);
                list.add(BASE);
                for (int i = 0; i < 10; ++i) {
                    list.add(-BASE);
                }
                list.add(1);
                list.add(rem / 2 - 1);

                out.println(list.size());
                for (int i = 0; i < list.size(); ++i) {
                    if (i > 0) out.print(" ");
                    out.print(list.get(i));
                }
                out.println();
                return;
            }

        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new UnknownError();
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int k = in.nextInt();
            if (k <= 1000000 - 2) {
                out.println(2);
                out.println(-1 + " " + (k + 2));
                return;
            }

            for (int BASE = 600000; BASE < 600010; ++BASE) {

                int num = (k + BASE - 2) / (BASE - 1);

                int rem = 0;
                while (true) {
                    rem = (BASE - 1) * num - k;
                    if (rem <= BASE || num < 2) {
                        ++num;
                    } else {
                        break;
                    }
                }

                if (rem % 2 != 0) {
                    ++num;
                    rem = (BASE - 1) * num - k;
                }
                if (rem % 2 != 0) continue;

                List<Integer> list = new ArrayList<>();
                for (int i = 0; i < num - 2; ++i) {
                    list.add(0);
                }
                list.add(-1);
                list.add(BASE);
                for (int i = 0; i < 10; ++i) {
                    list.add(-BASE);
                }
                list.add(1);
                list.add(rem / 2 - 1);

                out.println(list.size());
                for (int i = 0; i < list.size(); ++i) {
                    if (i > 0) out.print(" ");
                    out.print(list.get(i));
                }
                out.println();
                return;
            }

        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new UnknownError();
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int k = in.nextInt();
            if (k <= 1000000 - 2) {
                out.println(2);
                out.println(-1 + " " + (k + 2));
                return;
            }

            for (int BASE = 611050; ; ++BASE) {

                int num = (k + BASE - 2) / (BASE - 1);

                int rem = 0;
                while (true) {
                    rem = (BASE - 1) * num - k;
                    if (rem <= BASE || num < 2) {
                        ++num;
                    } else {
                        break;
                    }
                }

                if (rem % 2 != 0) continue;

                List<Integer> list = new ArrayList<>();
                for (int i = 0; i < num - 2; ++i) {
                    list.add(0);
                }
                list.add(-1);
                list.add(BASE);
                for (int i = 0; i < 10; ++i) {
                    list.add(-BASE);
                }
                list.add(1);
                list.add(rem / 2 - 1);

                out.println(list.size());
                for (int i = 0; i < list.size(); ++i) {
                    if (i > 0) out.print(" ");
                    out.print(list.get(i));
                }
                out.println();
                return;
            }

        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    throw new UnknownError();
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        for (int i = 2; i < 2001; i++) {
            long s = k + i;
            if (s / (i - 1) <= (1e6 - 3) && s - (1l * (i - 2) * (s / (i - 1))) <= 1e6) {
                ArrayList<Integer> res = new ArrayList<>();
                res.add(-1);
                long sum = 0;
                for (int j = 0; j < i - 2; j++) {
                    res.add((int) (s / (i - 1)));
                    sum += s / (i - 1);
                }
                res.add((int)(s - sum));
                print(out, res);
                break;
            }
        }

        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        int mult = Math.max(2, k / 10);

//        if(k % 2 == 0) {
//            int MB = k + 4;
            int add = 4;
            while((k + add) % mult != 0 || k + add == mult || add <= mult) add++;
            ArrayList<Integer> arr = new ArrayList<>();
            arr.add(add);
            int L = (k + add) / mult; // Can be big, small
            if ((L - 1) % 2 == 0) {
                arr.add(-(add - mult) + 1);
                arr.add(-1);
                for (int i = 0; i < (L - 3) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            } else {
                arr.add(-(add - mult));
                for (int i = 0; i < (L - 2) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            }
            Collections.sort(arr);
            print(out, arr);
//        }

        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        int mult = Math.max(2, k / 10);

//        if(k % 2 == 0) {
//            int MB = k + 4;
            int add = 4;
            while((k + add) % mult != 0 || k + add == mult || add <= mult) add++;
            ArrayList<Integer> arr = new ArrayList<>();
            arr.add(add);
            int L = (k + add) / mult; // Can be big, small
            if ((L - 1) % 2 == 0) {
                arr.add(-(add - mult) + 1);
                arr.add(-1);
                for (int i = 0; i < (L - 3) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            } else {
                arr.add(-(add - mult));
                for (int i = 0; i < (L - 2) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            }
            Collections.sort(arr, Collections.reverseOrder());
            arr.add(arr.get(0));
            arr.remove(0);
            print(out, arr);
//        }

        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        int mult = Math.max(2, k / 10);

//        if(k % 2 == 0) {
//            int MB = k + 4;
            int add = 4;
            while((k + add) % mult != 0 || k + add == mult || add <= mult) add++;
            ArrayList<Integer> arr = new ArrayList<>();
            arr.add(add);
            int L = (k + add) / mult; // Can be big, small
            if ((L - 1) % 2 == 0) {
                arr.add(-(add - mult) + 1);
                arr.add(-1);
                for (int i = 0; i < (L - 3) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            } else {
                arr.add(-(add - mult));
                for (int i = 0; i < (L - 2) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            }
            print(out, arr);
//        }

        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        int mult = Math.max(2, k / 10);

//        if(k % 2 == 0) {
//            int MB = k + 4;
            int add = 4;
            while((k + add) % mult != 0 || k + add == mult || add <= mult) add++;
            ArrayList<Integer> arr = new ArrayList<>();
            arr.add(add);
            int L = (k + add) / mult; // Can be big, small
            if ((L - 1) % 2 == 0) {
                arr.add(-(add - mult) + 1);
                arr.add(-1);
                for (int i = 0; i < (L - 3) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            } else {
                arr.add(-(add - mult));
                for (int i = 0; i < (L - 2) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            }
            print(out, arr);
//        }

        out.println();
        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        for (int i = 2; i < 2001; i++) {
            long s = k + i;
            if (s / (i - 1) <= (1e6 - 3)) {
                ArrayList<Integer> res = new ArrayList<>();
                res.add(-1);
                long sum = 0;
                for (int j = 0; j < i - 2; j++) {
                    res.add((int) (s / (i - 1)));
                    sum += s / (i - 1);
                }
                res.add((int)(s - sum));
                print(out, res);
                break;
            }
        }

        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        for (int i = 2; i < 2001; i++) {
            long s = k + i;
            if (s / (i - 1) <= (1e6 - 3) && s - (1l * (i - 2) * s / (i - 1)) <= 1e6) {
                ArrayList<Integer> res = new ArrayList<>();
                res.add(-1);
                long sum = 0;
                for (int j = 0; j < i - 2; j++) {
                    res.add((int) (s / (i - 1)));
                    sum += s / (i - 1);
                }
                res.add((int)(s - sum));
                print(out, res);
                break;
            }
        }

        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class Main {
    static void print(PrintWriter out, ArrayList<Integer> arr) {
        out.println(arr.size());
        for (int i = 0; i < arr.size(); i++) {
            if(i > 0) out.print(" ");
            out.print(arr.get(i));
        }
        out.println();
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int k = sc.nextInt();
        int mult = Math.max(2, k / 1000);

//        if(k % 2 == 0) {
//            int MB = k + 4;
            int add = 4;
            while((k + add) % mult != 0 || k + add == mult || add <= mult) add++;
            ArrayList<Integer> arr = new ArrayList<>();
            arr.add(add);
            int L = (k + add) / mult; // Can be big, small
            if ((L - 1) % 2 == 0) {
                arr.add(-(add - mult) + 1);
                arr.add(-1);
                for (int i = 0; i < (L - 3) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            } else {
                arr.add(-(add - mult));
                for (int i = 0; i < (L - 2) / 2; i++) {
                    arr.add(-1);
                    arr.add(1);
                }
            }
            Collections.sort(arr, Collections.reverseOrder());
            arr.add(arr.get(0));
            arr.remove(0);
            print(out, arr);
//        }

        out.flush();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        System.out.println(2000);
        int x = 1999 - k % 1999;
        for (int i = 0; i < 1998; i++)
            System.out.print(0 + " ");
        System.out.print(-x + " ");
        System.out.println((k + x) / 1999 + x);
    }

}


"""
    Author - Satwik Tiwari .
    17th Oct , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

# from itertools import *
from heapq import *
from math import gcd, factorial,floor,ceil

from copy import deepcopy
from collections import deque

# from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
# from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
# from itertools import permutations as permutate

from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

mod = 10**9+7
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for pp in range(t):
        solve(pp)
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def help(val,part):
    temp = val//part
    rem = val%part
    return (temp**2)*(part-rem) + ((temp+1)**2)*rem

def solve(case):
    n,k = sep()
    a = lis()

    curr = 0
    for i in range(n):
        curr+=a[i]**2

    h = []
    for i in range(n):
        heappush(h,(help(a[i],2) - help(a[i],1),a[i],1))
    cnt = n
    # print(h)
    while(cnt<k):
        temp = heappop(h)
        v,p = -temp[1],temp[2]
        curr -= help(v,p)
        curr+=help(v,p+1)
        heappush(h,(help(v,p+2)-help(v,p+1),v,p+1))
        cnt+=1

        # curr-=temp**2
        # if(temp%2==0):
        #     curr+=2*((temp//2)**2)
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2))
        # else:
        #     curr+=(temp//2)**2
        #     curr+= (ceil(temp/2))**2
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2+1))
        # print(h,curr)

    print(curr)

testcase(1)
# testcase(int(inp()))


"""
    Author - Satwik Tiwari .
    17th Oct , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

# from itertools import *
from heapq import *
from math import gcd, factorial,floor,ceil

from copy import deepcopy
from collections import deque

# from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
# from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
# from itertools import permutations as permutate

from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

mod = 10**9+7
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for pp in range(t):
        solve(pp)
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def help(val,part):
    temp = val//part
    rem = val%part
    return (temp**2)*(part-rem) + ((temp+1)**2)*rem

def solve(case):
    n,k = sep()
    a = lis()

    curr = 0
    for i in range(n):
        curr+=a[i]**2

    h = []
    parts = [1]*n
    for i in range(n):
        heappush(h,(help(a[i],2) - help(a[i],1),i))
    cnt = n
    # print(h)
    while(cnt<k):
        temp = heappop(h)
        diff,ele = temp[0],temp[1]
        curr+=diff
        parts[ele]+=1
        heappush(h,(help(a[ele],parts[ele]+1) - help(a[ele],parts[ele]),ele))
        # curr -= help(v,p)
        # curr+=help(v,p+1)
        # heappush(h,(help(v,p+2)-help(v,p+1),v,p+1))
        cnt+=1

        # curr-=temp**2
        # if(temp%2==0):
        #     curr+=2*((temp//2)**2)
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2))
        # else:
        #     curr+=(temp//2)**2
        #     curr+= (ceil(temp/2))**2
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2+1))
        # print(h,curr)

    print(curr)

testcase(1)
# testcase(int(inp()))


"""
    Author - Satwik Tiwari .
    17th Oct , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

# from itertools import *
from heapq import *
from math import gcd, factorial,floor,ceil

from copy import deepcopy
from collections import deque

# from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
# from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
# from itertools import permutations as permutate

from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

mod = 10**9+7
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for pp in range(t):
        solve(pp)
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def help(val,part):
    temp = val//part
    rem = val%part
    return (temp**2)*(part-rem) + ((temp+1)**2)*rem

def solve(case):
    n,k = sep()
    a = lis()

    curr = 0
    for i in range(n):
        curr+=a[i]**2

    h = []
    for i in range(n):
        heappush(h,(help(a[i],2) - help(a[i],1),a[i],1))
    cnt = n
    print(h)
    while(cnt<k):
        temp = heappop(h)
        v,p = -temp[1],temp[2]
        curr -= help(v,p)
        curr+=help(v,p+1)
        heappush(h,(help(v,p+2)-help(v,p+1),v,p+1))
        cnt+=1

        # curr-=temp**2
        # if(temp%2==0):
        #     curr+=2*((temp//2)**2)
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2))
        # else:
        #     curr+=(temp//2)**2
        #     curr+= (ceil(temp/2))**2
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2+1))
        # print(h,curr)

    print(curr)

testcase(1)
# testcase(int(inp()))


"""
    Author - Satwik Tiwari .
    17th Oct , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

# from itertools import *
from heapq import *
# from math import gcd, factorial,floor,ceil

from copy import deepcopy
from collections import deque

# from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
# from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
# from itertools import permutations as permutate

from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
# from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

mod = 10**9+7
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for pp in range(t):
        solve(pp)
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def help(val,part):
    temp = val//part
    rem = val%part
    return (temp*temp)*(part-rem) + ((temp+1)*(temp+1))*rem

def solve(case):
    n,k = sep()
    a = lis()

    curr = 0
    for i in range(n):
        curr+=a[i]*a[i]

    h = []
    parts = [1]*n
    for i in range(n):
        heappush(h,(help(a[i],2) - help(a[i],1),i))
    cnt = n

    while(cnt<k):
        temp = heappop(h)
        # print(temp)
        diff,ele = temp[0],temp[1]
        curr+=diff
        parts[ele]+=1
        heappush(h,(help(a[ele],parts[ele]+1) - help(a[ele],parts[ele]),ele))
        cnt+=1

    print(curr)

testcase(1)
# testcase(int(inp()))


"""
    Author - Satwik Tiwari .
    17th Oct , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

# from itertools import *
from heapq import *
# from math import gcd, factorial,floor,ceil

from copy import deepcopy
from collections import deque

# from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
# from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
# from itertools import permutations as permutate

from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
# from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

mod = 10**9+7
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for pp in range(t):
        solve(pp)
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))
def help(val,part):
    temp = val//part
    rem = val%part
    return (temp**2)*(part-rem) + ((temp+1)**2)*rem

def solve(case):
    n,k = sep()
    a = lis()

    curr = 0
    for i in range(n):
        curr+=a[i]**2

    h = []
    parts = [1]*n
    for i in range(n):
        heappush(h,(help(a[i],2) - help(a[i],1),i))
    cnt = n
    # print(h)
    while(cnt<k):
        temp = heappop(h)
        diff,ele = temp[0],temp[1]
        curr+=diff
        parts[ele]+=1
        heappush(h,(help(a[ele],parts[ele]+1) - help(a[ele],parts[ele]),ele))
        # curr -= help(v,p)
        # curr+=help(v,p+1)
        # heappush(h,(help(v,p+2)-help(v,p+1),v,p+1))
        cnt+=1

        # curr-=temp**2
        # if(temp%2==0):
        #     curr+=2*((temp//2)**2)
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2))
        # else:
        #     curr+=(temp//2)**2
        #     curr+= (ceil(temp/2))**2
        #     heappush(h,-(temp//2))
        #     heappush(h,-(temp//2+1))
        # print(h,curr)

    print(curr)

testcase(1)
# testcase(int(inp()))


"""
    Author - Satwik Tiwari .
    17th Oct , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

# from itertools import *
from heapq import *
from math import gcd, factorial,floor,ceil

from copy import deepcopy
from collections import deque

# from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
# from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
# from itertools import permutations as permutate

from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

mod = 10**9+7
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for pp in range(t):
        solve(pp)
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))

def solve(case):
    n,k = sep()
    a = lis()

    curr = 0
    for i in range(n):
        curr+=a[i]**2

    h = []
    for i in range(n):
        heappush(h,-a[i])

    while(len(h)<k):

        temp = -heappop(h)

        curr-=temp**2
        if(temp%2==0):
            curr+=2*((temp//2)**2)
            heappush(h,-(temp//2))
            heappush(h,-(temp//2))
        else:
            curr+=(temp//2)**2
            curr+= (ceil(temp/2))**2
            heappush(h,-(temp//2))
            heappush(h,-(temp//2+1))
        # print(h,curr)

    print(curr)

testcase(1)
# testcase(int(inp()))


import heapq
n, k = map(int, input().split())
A = list(map(int, input().split()))
rem = k - n
heapq.heapify(A)
for _ in range(rem):
    cur = heapq.heappop(A)
    heapq.heappush(A, cur // 2)
    heapq.heappush(A, cur - cur // 2)
ans = sum(a ** 2 for a in A)
print(ans)


import heapq
n, k = map(int, input().split())
A = list(map(int, input().split()))
rem = k - n
hp = [-a for a in A]
heapq.heapify(hp)
for _ in range(rem):
    cur = -heapq.heappop(hp)
    heapq.heappush(hp, -cur // 2)
    heapq.heappush(hp, cur // 2 - cur)
ans = sum(h ** 2 for h in hp)
print(ans)


import heapq
n, k = map(int, input().split())
A = list(map(int, input().split()))
rem = k - n
hp = [-a for a in A]
heapq.heapify(hp)
for _ in range(rem):
    cur = -heapq.heappop(hp)
    heapq.heappush(hp, -cur // 2)
    heapq.heappush(hp, cur // 2 - cur)
print(hp)
ans = sum(h ** 2 for h in hp)
print(ans)


import heapq
n, k = map(int, input().split())
A = list(map(int, input().split()))
rem = k - n
heapq.heapify(A)
for _ in range(rem):
    cur = heapq.heappop(A)
    heapq.heappush(A, cur // 2)
    heapq.heappush(A, cur - cur // 2)
print(A)
ans = sum(a ** 2 for a in A)
print(ans)


import heapq
n, k = map(int, input().split())
A = list(map(int, input().split()))

def cal(x, m):
    k, r = divmod(x, m)
    return r * (k + 1) ** 2 + (m - r) * k ** 2

hp = [(cal(a, 2) - cal(a, 1), a, 2) for a in A]
heapq.heapify(hp)
ans = sum(a ** 2 for a in A)
for _ in range(k - n):
    d, x, m = heapq.heappop(hp)
    ans += d
    heapq.heappush(hp, (cal(x, m + 1) - cal(x, m), x, m + 1))
print(ans)


import heapq
n, k = map(int, input().split())
A = list(map(int, input().split()))
rem = k - n
hp = [-a for a in A]
heapq.heapify(hp)
for _ in range(rem):
    cur = -heapq.heappop(hp)
    heapq.heappush(hp, -(cur // 2))
    heapq.heappush(hp, -(cur - cur // 2))
ans = sum(h ** 2 for h in hp)
print(ans)


def mi():return (map(int,input().split()))
from heapq import heappop, heappush, heapify
n,k=mi()
arr=list(mi())
if n!=1:
    for i in range(n):
        arr[i]*=-1
    heapify(arr)
    while len(arr)<k:
        x=heappop(arr)*(-1)
        y=heappop(arr)*(-1)
        heappush(arr,-1*y)
        d=2
        while d<k-len(arr):
            if x//d+x%d<=y:
                break
            else:
                d+=1
        heappush(arr,-1*(x//d+x%d))
        j=1
        while j<d:
            heappush(arr,-1*(x//d))
            j+=1
    out=0
    for i in arr:
        out+=i**2
    print(out)
else:
    n=arr[0]
    out=((n//k+1)**2)*(n%k)
    out+=((n//k)**2)*(k-n%k)
    print(out)


import heapq

def cost(L, m):
    """Min cost (time) of cutting L into m pieces.
    L = p1^2+...+pm^2, L is minimized when cutting as evenly as possible.
    """
    min_len = L//m
    rem = L-min_len*m
    # "Spread" rem across rem pieces, each receives +1 in len, so we have rem pieces of len `min_len+1` and m-rem pieces of len `min_len`.
    return (m-rem) * min_len * min_len + rem * (min_len+1) * (min_len+1)

def solve(a, n, k):
    pq = []
    total = 0
    for c in a:
        total += c*c
        # decrease in cost by cutting c in 2 pieces (compared to no cut)
        decrease_in_cost = cost(c, 1)-cost(c, 2)
        # Max heap by negating value
        pq.append((-decrease_in_cost, c, 2))

    heapq.heapify(pq)  # heapify modifies pq in-place, returns None!

    # Since we start with n pieces and end with k pieces, so the number of cut is k-n
    for _ in range(k-n):
        top = heapq.heappop(pq)
        total += top[0]
        c, m = top[1], top[2]
        decrease_in_cost = cost(c, m) - cost(c, m+1)
        heapq.heappush(pq, (-decrease_in_cost, c, m+1))
        # Why does this work?
        # Note at some point if we find that it's better to cut c in m2 pieces than the current cutting in m1 pieces, cost(c, 1) - cost(c, m1) + cost(c, m1) - cost(c, m2) = cost(c,1) - cost(c,m2).

    return total

n, k = (int(x) for x in input().split())
a = list(int(x) for x in input().split())

print(solve(a, n, k))


def mi():return (map(int,input().split()))
from heapq import heappop, heappush, heapify
n,k=mi()
arr=list(mi())
for i in range(n):
    arr[i]*=-1
heapify(arr)
while len(arr)<k:
    x=heappop(arr)*(-1)
    a=x//2
    b=x-a
    heappush(arr,-1*a)
    heappush(arr,-1*b)
out=0
for i in arr:
    out+=i**2
print(out)


def mi():return (map(int,input().split()))
from heapq import heappop, heappush, heapify
n,k=mi()
arr=list(mi())
if n!=1:
    for i in range(n):
        arr[i]*=-1
    heapify(arr)
    while len(arr)<k:
        x=heappop(arr)*(-1)
        y=heappop(arr)*(-1)
        heappush(arr,-1*y)
        d=2
        while d<k-len(arr):
            if x//d+1<=y:
                break
            else:
                d+=1
        j=0
        while j<x%d:
            heappush(arr,-1*(x//d+1))
            j+=1
        while j<d:
            heappush(arr,-1*(x//d))
            j+=1
    out=0
    for i in arr:
        out+=i**2
    print(out)
else:
    n=arr[0]
    out=((n//k+1)**2)*(n%k)
    out+=((n//k)**2)*(k-n%k)
    print(out)