Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define fastio ios_base::sync_with_stdio(0); cin.tie(0)
- const int N = 2e5 + 5;
- int gcd(int a , int b){
- if(b == 0) return a;
- return gcd(b , a % b);
- }
- int lcm(int a , int b){
- return a / gcd(a , b) * b;
- }
- signed main()
- {
- fastio;
- int a , b;
- cin >> a >> b;
- cout << gcd(a , b) << ' ' << lcm(a , b) << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement