Thursday, January 24, 2008

Back To High School Physics : Problem No.10071

#include<iostream>

using namespace std;

int main()
{
int a,b;

cin>>a>>b;

while(cin>>a>>b)
{
cout<<2*a*b<<endl;
if(a==-1 && b==-1)
{
break;
}
}
}

Problem submitted with runtime = 0.410

Do comment for better algorithm or lesser runtime solution.

No comments: