20131017-02

UVA 10324: A little trick here, a bit slow if you use java.