铺成黑白相间花格子正方形的单人纸牌游戏
#include <iostream>
#include <cmath>
//看了博友的程序才理解题意
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
if((a==0)&&(b==0))
{
cout<<"Impossible"<<endl;
}else if(a==b)
{
int c=sqrt(a+b);
cout<<c;
}else if(a>b)
{
int c=sqrt(b*2+1);//抄了一下
cout<<c;
}else if(b>a)
{
int c=sqrt(a*2+1);
cout<<c;
}
return 0;
}