Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <cstdio>
- #include <vector>
- #include <cmath>
- #include <string>
- #include <algorithm>
- #include <string>
- #include <deque>
- #include <iomanip>
- #include <cstddef>
- #define F first
- #define S second
- using namespace std;
- const long double eps = 0.000000005;
- const long double pi = 3.1415926535897932;
- const long long inf = 1e9;
- vector<vector<int, int> > g;
- vector<bool> used;
- vector <int> d;
- int gcd_ext(int& x, int& y, int a, int b)
- {
- if (b == 0)
- {
- x = 1;
- y = 0;
- return a;
- }
- int x1, y1;
- int g = gcd_ext(x1, y1, b, a%b);
- x = y1;
- y = x1 - y1 * a / b;
- }
- int main()
- {
- ios_base::sync_with_stdio(0);
- //freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
- // freopen("slalom.in", "r", stdin);freopen("slalom.out", "w", stdout);
- int a, b, c;
- cin >> a >> b >> c;
- int x, y;
- int ans = gcd_ext(x, y, a, b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement