Create uva_10812.java

Solution for uva_10812 problem