solved some samples on kattis.