usaco: namenum solution in java and C++

Signed-off-by: Rohit Yadav <bhaisaab@baagi.org>