VPEX P0 - Pizza

View as PDF

Submit solution

Points: 1 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
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

Sharing is caring, and Darcy_Liu loves to share. If he has x slices of pizza to give away and split evenly among his N friends, how many slices can he give to each, and how many will be left over?

Input

One line consisting of 2 integers x and N (1 \le x,N \le 10^9).

Output

For each test case, output 1 line containing the number of slices each friend will get followed by the number of slices left over.

Sample Input

5 2

Sample Output

2 1

Sample Input

9 3

Sample Output

3 0

Explanation

For the 1st test case, he has 5 slices and 2 friends. He can give each friend 2 slices with 1 left over.

For the 2nd case, he has 9 slices and 3 friends. He can give 3 to each friend, splitting them evenly with none left over.


Comments


  • 0
    hjanday  commented on May 10, 2020, 6:19 p.m.

    Not sure what's going on with my code, but I've tried numerous test cases on my ide and they go through and the sample case works but I'm getting WA. I tried to use modular arithemetic but I am getting WA