Cheap, Fast, Good - Common Factor (Greatest)
C
It's cheap and fast. You get gcd in the blink of an eye. However the guy who did it had no clue about that &quot;Bézier co-something&quot; so he simply divided a and b by gcd.
(to make things worse, at that point a and b are pretty far from their initial value because of the algorithm he wisely chose)
int main(int argc, char **argv){
    unsigned int a, b, tmp;
    a = (unsigned int)atoi(argv[1]);
    b = (unsigned int)atoi(argv[2]);
    for (tmp = 0; ((a | b) & 1) == 0; ++tmp){
        a &gt;&gt;= 1;
        b &gt;&gt;= 1;
    }
    while ((a & 1) == 0) 
        a &gt;&gt;= 1;
    do {
        while ((b & 1) == 0)
            b &gt;&gt;= 1;
        if (a &gt; b){
            unsigned int t = b; 
            b = a; 
            a = t;
        }  
        b = b - a;
    } while (b != 0);
    tmp = a &lt;&lt; tmp;
    printf("%u, (%u,%u)", tmp, a/tmp, b/tmp);
    return 0;
}