Java tutorial
//package com.java2s; //License from project: LGPL import java.math.BigInteger; public class Main { private static int gcd(int a, int b) { return BigInteger.valueOf((long) a).gcd(BigInteger.valueOf((long) b)).intValue(); } }