My code passed only first 5 cases, please check my code here :
Linear Congruence error
@shivanshu12800 hey just change line 58 with this line
x += ((rem[i] * pp * inverse)%prod);
otherwise all is fine.
still the same …
@shivanshu12800 hey it is passing all the test cases . try submitting again. if not share your code
see the ss
use long long everywhere.