1 / 5
Jul 2014

what's problem in this code......it's showing WA(7).but working fine on my pc

include

define LL long long

using namespace std;

int main()
{ LL t,i,a,c,b,d,n,sum;
cin>>t;

while(t--)
{
      cin>>b>>c>>sum;
  n=(sum*2)/(c+b);
  d=(c-b)/(n-5);
  a=b-2*d;
  cout<<n<<endl;
  for(i=0;i<n;i++)
  {cout<<(a+i*d)<<" ";}
  cout<<endl<<endl;
}
return 0;

}

//please reply

Please use code tags when posting code.

This problem makes it pretty easy to generate a lot of test cases easily. How have you tested your code?

The sample inputs in the problem statement are meant simply to show you how the input is structured. They are not meant to be exhaustive. You need to test more.

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 16 9d

Want to read more? Browse other topics in C and C++ or view latest topics.