Skip to content

Instantly share code, notes, and snippets.

@abdalimran
Created February 12, 2016 19:08
Show Gist options
  • Save abdalimran/9d4a8172bbb979b6c6e9 to your computer and use it in GitHub Desktop.
Save abdalimran/9d4a8172bbb979b6c6e9 to your computer and use it in GitHub Desktop.
/* Bismillah hir rahmanir raheem. Thanks to Allah for everything.
Coder: Abdullah Al Imran
Email: [email protected] */
#include<bits/stdc++.h>
using namespace std;
typedef pair <int,int> pii;
#define x first
#define y second
pii extendedEuclid (int a, int b)
{ // returns x, y | ax + by = gcd(a,b)
if(b==0)
return pii(1,0);
else
{
pii d = extendedEuclid(b, a%b);
return pii(d.y, d.x-d.y * (a/b));
}
}
int main()
{
ios_base::sync_with_stdio(false);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment