Wrote Problem in C, Java, and Python