设为首页 加入收藏

TOP

URAL 2001 Mathematicians and Berries (小学数学题)
2015-07-20 17:12:43 来源: 作者: 【 】 浏览:2
Tags:URAL 2001 Mathematicians and Berries 小学 数学题

Mathematicians and Berries

Time limit: 0.5 second
Memory limit: 64 MB
One day, two mathematicians were walking in the forest and picking berries. They’d been walking for two hours, and then they stopped and decided to see who’s got more berries. They took out the scales (can you imagine a mathematician going to the forest without any scales?) and they weighed their baskets with berries. They wrote the resulting numbers a1 and b1 down on a piece of paper. Then the second mathematician put all his berries to the first one’s basket (so that his basket became completely empty) and they weighed their baskets again and they received numbers a2 and b2, correspondingly. At last, the first mathematician put all the berries to the second one’s basket (so that his basket became completely empty); they weighed the baskets and got numbers a3 and b3, correspondingly. This data was enough to find the winner and the happy mathematicians moved on. Your task is to calculate the mass of the berries in each mathematician’s basket by the start of the competition.

Input

The input data consists of three lines. The i’th line (1 ≤ i ≤ 3) contains integers a i and b i (0 ≤ a i, b i ≤ 10 000).

Output

Output the weight of berries in the basket of the first and the second mathematician correspondingly.

Sample

input output
1 2
2 1
0 3
1 1




解析:简单计算。



AC代码:

#include 
  
   

int a[3], b[3];

int main(){
    while(scanf("%d%d%d%d%d%d", &a[0], &b[0], &a[1], &b[1], &a[2], &b[2])==6){
        printf("%d %d\n", a[0] - a[2], b[0] - b[1]);
    }
    return 0;
}

  



】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDU 2896 病毒侵袭(AC自动机) 下一篇poj 2311 Cutting Game nim与状态..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·有没有哪些高效的c++ (2025-12-27 08:20:57)
·Socket 编程时 Accep (2025-12-27 08:20:54)
·计算机网络知识点总 (2025-12-27 08:20:52)
·一篇说人话的文章, (2025-12-27 07:50:09)
·Python Web框架哪家 (2025-12-27 07:50:06)