fork download
  1. #include <iostream>
  2.  
  3.  
  4.  
  5.  
  6. int main() {
  7. int a, b, iloczyn, test;
  8. std::cin >> test;
  9.  
  10. do {
  11. std::cin >> a >> b;
  12. iloczyn = a * b;
  13. do {
  14. if (a > b) {
  15. a = a - b;
  16. } else {
  17. b = b - a;
  18. }
  19. } while (a != b);
  20. std::cout << iloczyn / a << '\n';
  21. --test;
  22. } while (test != 0);
  23. return 0;
  24. }
  25.  
  26.  
Time limit exceeded #stdin #stdout 5s 16064KB
stdin
2 
11 11
10 20

stdout
Standard output is empty