D homework (GCD for vectors)