
import java.math.BigDecimal;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author LH
 */
public class Kgv
{
    public static void main(String[] args) throws Exception
    {
        
        
    }
    
    
    public static BigDecimal calculateKGV(BigDecimal x, BigDecimal y)
    {
        return x.multiply(y).divide(calculateGGT(x, y));
    }
    
    public static  BigDecimal calculateGGT(BigDecimal x, BigDecimal y)
    {
        if(y.intValue()==0)//nullercheck
        {
            return x;
        }
        return calculateGGT(y, x.remainder(y));
    }
    
    
}
