Thứ Hai, 16 tháng 5, 2022

TOADO C++


#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll m, n,p,q,a,b;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    //freopen("ps.inp","r",stdin);
   // freopen("ps.out","w",stdout);
    cin>>m>>n>>p>>q;
    ll a=abs(m-p);
    ll b=abs(n-q);
    cout<<__gcd(a,b)-1;
}

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.