4 integers are given (all no more than 10^6): m, n, k, l. If m % n == k or m % n == l, then print 1, else any other number. Conditional operators cannot be used!
Examples:
12 8 3 4 // input
1 // output
0 5 1 2 // input
0 // output
I wrote this code:
#include <iostream>
using namespace std;
int main()
{
int m, n, k, l;
cin >> m >> n >> k >> l;
cout << ((1 / (((m % (n + 1 / (n + 1))) - k) * ((m % (n + 1 / (n + 1))) - k) + 1)) - 1) * ((1 / (((m % (n + 1 / (n + 1))) - l) * ((m % (n + 1 / (n + 1))) - l) + 1)) - 1) + 1;
return 0;
}
But it does not work for all cases. For example, 0, 0, 0, 0 gives 1, but should give any other number. Please help.