If failing for larger test cases


#1

use long long for maxp and mid