anhkiet2507

SO LAP LAI - AC

Aug 29th, 2021 (edited)
1,456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. #include<string>
  4. #include <iomanip>
  5. long long UCLN(long long a, long long b){
  6.     if(b==0){
  7.         return a;
  8.     } else {
  9.     return UCLN(b,a%b);
  10.     }
  11. }
  12. using namespace std;
  13. int main() {
  14.     int t;
  15.     cin >> t;
  16.     while(t--){
  17.         long long a,x,y,i,j;
  18.         cin >> a >> x >> y;
  19.         long long lap = UCLN(x,y);
  20.         for(i = 0; i<lap; i++){
  21.             cout << a;
  22.         }
  23.         cout << endl;
  24.     }
  25. }
  26.  
  27.  
  28.  
  29.  
Add Comment
Please, Sign In to add comment