Deleted unnecessary testi.in. Modified solving algorithm.