COCI '18 Contest 1 #1 Nadan

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Alongside being a palindrome, Nadan is also a successful businessman who finances young software developers when they start working on their projects. This year, he decided to distribute K kunas (Croatian currency) to N projects in a way that each project gets at least one kuna and all projects get a different amounts of kunas. This will always be possible.

Write a program which will, for a given N and K, find one possible distribution of K kunas to N projects.

Input Specification

The first line contains a positive integer K (100 \le K \le 1\,000\,000), number from the task description.

The second line contains a positive integer N (1 \le N \le 100), number from the task description.

Output Specification

For a chosen money distribution, output the amount of money the first project will get in the first line, the amount of money the second project will get in the second line and so on until the N-th line where you should output the amount of money the N-th project will get.

Scoring

In cases worth 25 points, it will hold that N = 5.

If your solution outputs a distribution where all projects didn't get a different amount of kunas, you will get 3 out of the possible 5 points for that test case.

Sample Input 1

100
5

Sample Output 1

10
30
20
5
35

Sample Input 2

200
1

Sample Output 2

200

Sample Input 3

100
4

Sample Output 3

21
36
12
31

Comments


  • 0
    sankeeth_ganeswaran  commented on June 18, 2019, 12:21 p.m.

    Did I misunderstand the problem how is my solution wrong?


    • 1
      Rimuru  commented on June 18, 2019, 1:39 p.m. edited

      wheeze imagine having a broken checker... I'll fix it later today and rejudge submissions.

      Edit: wait no i can just defer to Pookmeister ohohohoho