P174, P179, P203, P205: Added Mathematica solution.
P203: Clarified Java solution.
P146: Added Java solution.