Program solves all test cases correctly