The problem is CodeChef: Practical coding for everyone
I used Arithmetic progression formula in my both solutions CodeChef: Practical coding for everyone CodeChef: Practical coding for everyone
In CodeChef: Practical coding for everyone i did not used inverse modulo and hence divided the problem into two cases (depending on number of terms in arithmetic progression is odd or even).I think may be due to large number of operations some miscalculation happens as a corner case .But logic is right and it is failing only one test case .can someone figure out the mistake ?
In CodeChef: Practical coding for everyone i solved the problem directly (without making cases by using inverse modulo).All test cases got passed.