oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

sharefood Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

sharefood.html

Problem Description

Rar the Cat likes to give out cat food to his fellow cat buddies. Today, he has just received a gift of N cans of cat food from his owner, Mr Randy and he wants to share them with his group of C cat buddies!

However, since he is the "owner" of the food and he must be fair to everyone else (except himself), all of his cat buddies must receive the same number of cans of cat food, and the amount he is left with must be more than or equal to the amount of cat food the other cats have received.

Since Rar the Cat is a nice cat, he wants to give the most cans of cat food to each of his cat buddy. Thus, help Rar the Cat find out the number of cans of cat food he should give to each cat buddy and how many cans he would have for himself.

Input

The input will contain two integers, N and C.

Output

Your output should contain two integers, the amount of cat food each cat buddy receives, and the amount of cat food he is left with at the end.
Your output should be terminated by a newline.

Limits

Subtask 1 (21%): 1 ≤ N ≤ 1 000 000
Subtask 2 (33%): 1 ≤ N ≤ 1 000 000 000
Subtask 3 (46%): 1 ≤ N ≤ 1 000 000 000 000
Subtask 4 (0%): As per sample testcases
For all subtasks: 1 ≤ C ≤ 1 000

Sample Input 1

5 3

Sample Output 1

1 2

Sample Input 2

11 2

Sample Output 2

3 5

Tags

Ad Hoc

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
121501s32MBMinimum
233501s32MBMinimum
346501s32MBMinimum
4021s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o sharefood -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.