Search found 1 match

by Satish
Sat Apr 21, 2007 9:35 pm
Forum: Volume 106 (10600-10699)
Topic: 10673 - Play with Floor and Ceil
Replies: 11
Views: 8047

WA

#include<iostream.h>
int main(void)
{
long long int a,b,c,r,s,q,p;
cin>>a;
while(a--)
{
cin>>b>>c;
r=(b/c);
if(b%c==0)
s=(b/c);
else
s=r+1;
if((r+s)==b)
{p=1;q=1;}
else
{
if(c*s==b)
{p=0;q=c;}
else
{
if(b/c==1)
{p=c;q=b-c;}
}
}
cout<<p<<" "<<q<<endl;
}
return(0 ...

Go to advanced search