您的位置:首页 > 其它

【2011 Greater New York Regional 】Problem B The Rascal Triangle

2013-10-01 16:24 295 查看
一个简单的规律题,每一列都是一个等差数列;

代码:

#include<cstdio>
#define ll long long
using namespace std;

int main()
{
int p;
int ca=1;
scanf("%d",&p);
while(p--)
{
int a,b;
scanf("%d",&ca);
scanf("%d%d",&a,&b);
ll ans=(a-b)*b+1;
printf("%d %lld\n",ca,ans);
}
return 0;
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: