Guest User

Untitled

a guest
Jul 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <cstring>
  2. #include <string>
  3. #include <iostream>
  4. #include <cstdio>
  5.  
  6. using namespace std;
  7. typedef long long int64;
  8.  
  9. int t;
  10. int64 A,B,C;
  11. int main()
  12. {
  13. scanf("%d",&t);
  14. while(t--)
  15. {
  16. scanf("%lld%lld%lld",&A,&B,&C);
  17. bool found = false;
  18. for(int i=7; found == false ; ++i)
  19. {
  20. if((B-A)%(i-6)==0)
  21. {
  22. int64 D = (B-A)/(i-6);
  23. int64 T = A+B+D;
  24. if(T*i==2*C)
  25. {
  26. int64 F = A-2*D;
  27. printf("%d\n",i);
  28. for(int k=0; k<i; ++k)
  29. {
  30. printf("%lld ",F+k*D);
  31. }
  32. printf("\n"); found = true;
  33. }
  34. }
  35. }
  36. }
  37. return 0;
  38. }
Add Comment
Please, Sign In to add comment