1504:重叠面积

来源:互联网 发布:库存管理 php 源代码 编辑:程序博客网 时间:2024/05/29 13:42

1504:重叠面积


Description


zjahstu是个很厚道的ACMer,O(∩_∩)O~。。特为大家准备水题一道。。 
题目很简单,两个矩形,告诉你矩形1,矩形2的面积和他们的总面积,请你求两矩形重叠部分的面积。如果给你的情况不存在,就输出Impossible。

Input

第一个数是T,表示测试数据的组数。 后面有T行,每行3个整数(1~10000)。

Output

输出阴影部分的面积或者Impossible。

Sample Input

320 20 4020 20 3020 20 50

Sample Output

0
10
Impossible



#include<iostream>using namespace std;int main(){     int T,a,b,c;    cin>>T;    while(T--)    {        cin>>a>>b>>c;       int count=a+b-c;       if(count>=0)        cout<<count<<endl;       else        cout<<"Impossible"<<endl;    }}


原创粉丝点击