Mod or mod or mod
Statement
Did you know that modulo may give different answer depending on languages ? Do you know how it works ?
You'll have to give the 3 possibles results following these rules :
- A % B : remainder's values is positive and between 0 and |B|-1 inclusive.
- A % B : remainder is same sign as A
- A % B : remainder is same sign as B
You'll have to give the quotient too.
Remember that : A = quotient * B + remainder
Input description
<<Line 1>> [[number]]
<<Line 2>> [[divisor]]
Output description
<<Line 1>> [[quotient]] [[remainder]] for rule 1
<<Line 2>> [[quotient]] [[remainder]] for rule 2
<<Line 3>> [[quotient]] [[remainder]] for rule 3
Constraints
Game modes
Test cases
pos pos Test
Input
13
4
Output
3 1
3 1
3 1
Validator 1 Validator
Input
9
4
Output
2 1
2 1
2 1
neg pos Test
Input
-12
5
Output
-3 3
-2 -2
-3 3
Validator 2 Validator
Input
-63
8
Output
-8 1
-7 -7
-8 1
pos neg Test
Input
42
-12
Output
-3 6
-3 6
-4 -6
Validator 3 Validator
Input
57
-5
Output
-11 2
-11 2
-12 -3
neg neg Test
Input
-117
-17
Output
7 2
6 -15
6 -15
Validator 4 Validator
Input
-77
-8
Output
10 3
9 -5
9 -5
Solution language
Solution
Stub generator input