Nothing special…
public static int helper(int small, int large){
if(small == 0) return 0;
if(small == 1) return large;
int s = small/2;
int tmpProduct = helper(s,large);
if(small%2==0) return tmpProduct + tmpProduct;
else if(small%2 == 1) return tmpProduct + tmpProduct + large;
return 0;
}
public static int minProduct(int a, int b) {
// TODO Auto-generated method stub
int small = a<b ? a : b;
int large = a<b ? b : a;
return helper(small, large);
}