Advertisement
AzmayenSabil

Untitled

May 7th, 2021
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. using LL = long long;
  6. using ULL = unsigned long long;
  7.  
  8. const long long MOD = 1e9+7;
  9.  
  10.  
  11. #define INPUT(x) freopen(x,"r",stdin)
  12. #define OUTPUT(x) freopen (x,"w",stdout)
  13.  
  14.  
  15. #define pb push_back
  16. #define endl '\n'
  17. #define LCM(a,b) (a/__gcd(a,b))*b
  18. #define GCD(a,b) __gcd(a,b)
  19. #define SP(x,y) setprecision((y))<<fixed<<(x)
  20. #define PI acos(-1.0)
  21. #define distance(x1,y1,x2,y2) sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
  22.  
  23. #define taratari ios_base::sync_with_stdio(0);cin.tie(NULL);
  24.  
  25. int gcd(int a, int b)
  26. {
  27. if (a == 0)
  28. return b;
  29. return gcd(b % a, a);
  30. }
  31.  
  32. int commDiv(int a, int b)
  33. {
  34.  
  35. int n = gcd(a, b);
  36.  
  37.  
  38. int result = 0;
  39. for (int i = 1; i <= sqrt(n); i++) {
  40.  
  41. if (n % i == 0) {
  42. if (n / i == i)
  43. result += 1;
  44. else
  45. result += 2;
  46. }
  47. }
  48. return result;
  49. }
  50.  
  51. int main()
  52. {
  53. taratari
  54.  
  55. int t;
  56. cin>>t;
  57.  
  58. while(t--){
  59.  
  60. LL a,b;
  61. cin>>a>>b;
  62.  
  63. if(a==1 and b==1){
  64. cout<<"NO"<<endl;
  65. }
  66.  
  67. else{
  68.  
  69. cout<<"YES"<<endl;
  70.  
  71. LL x = (a*b*3)-a;
  72. LL y = a;
  73. LL z = a*b*3;
  74.  
  75. /*LL i = 2;
  76.  
  77. while(x==y){
  78. z = z*i;
  79. x = z - a;
  80. y = a;
  81. i++;
  82. }*/
  83.  
  84. cout<<x<<" "<<y<<" "<<z<<endl;
  85.  
  86. }
  87.  
  88.  
  89.  
  90. }
  91.  
  92.  
  93.  
  94. return 0;
  95.  
  96. }
  97.  
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement