AP - Complete The Series (Easy) problem
#include<iostream>
using namespace std;
int main()
{
long long int a3,l,s,t,n,d,a,m,i;
cin>>t;
while(t--)
{
cin>>a3>>l>>s;
n=(2*s)/(a3+l) ;
d=(l-a3)/(n-5);
a=a3-2*d;
cout<<n<<endl;
for(i=1;i<=n;i++)
{
m=a+(i-1)*d;
cout<<m<<" ";
}
}
return 0;
}
No comments:
Post a Comment