CF686A Free Ice Cream
题目描述
凯和格尔达开了个冰淇凌店。他们最开始有x个冰淇淋。冰淇淋是免费的。人们可以给他们提供d个冰淇淋,也可以从他们这里要d个冰淇淋。若他们的冰淇淋不够给要冰淇淋的人,要冰淇淋的人会失落,他们的冰淇淋不会减少。他们想知道收摊以后,他们还剩多少冰淇淋和有多少失落的人。
输入格式
输入n,x(1
输出格式
输出两个数,剩的冰淇淋数和失落的人数
说明/提示
Consider the first sample.
1. Initially Kay and Gerda have $ 7 $ packs of ice cream.
2. Carrier brings $ 5 $ more, so now they have $ 12 $ packs.
3. A kid asks for $ 10 $ packs and receives them. There are only $ 2 $ packs remaining.
4. Another kid asks for $ 20 $ packs. Kay and Gerda do not have them, so the kid goes away distressed.
5. Carrier bring $ 40 $ packs, now Kay and Gerda have $ 42 $ packs.
6. Kid asks for $ 20 $ packs and receives them. There are $ 22 $ packs remaining.