What !?!?
My code is much much shorter and also working correctly on test cases
:
#include <iostream>
int main () {
std::cout << 80 << std::endl;
std::cout << 508 << std::endl;
}
It’s not correct.
It’s easy to make your own tests, for example:
1
100000 2
0 1 100000 10000000
1 1 100000
And I think, you can count answer on paper and pen or ordinary calculator