fork download
  1.  
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. int ipt,x,t;
  9. cin >> ipt;
  10. vector<int>XI;
  11. while (ipt != 0)
  12. {
  13. int x,t;
  14. cin >> x;
  15. cin >> t;
  16. if(x < 0 || t < 0)
  17. {
  18. return 0;
  19. }
  20. for(int j = 2; j < t; j++)
  21. {
  22. if(j % x == 0 && j % t == 0)
  23. {
  24. x /= j;
  25. t /= j;
  26. XI.push_back(j);
  27. }
  28. else
  29. {
  30. XI.push_back(1);
  31. }
  32. }
  33.  
  34. ipt--;
  35. }
  36. return 0;
  37. }
  38.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
Standard output is empty