#include <stdio.h>
#include <math.h>
#include <assert.h>
// Define the lambda functions as regular C functions
int f(int a, int b) {
return ((b - a + 0.1) / (b - a + 0.2));
}
int mx(int a, int b) {
return f(a, b) * a + f(b, a) * b + a * (1 - f(a, b) - f(b, a));
}
int main() {
for (int i = -10; i < 10; i++) {
for (int j = -10; j < 10; j++) {
int t1 = mx(i, j);
int t2 = i > j ? i : j;
// Uncomment the line below to print f(i, j) values
// printf("f(%d, %d) = %f\n", i, j, f(i, j));
}
}
printf("All assertions passed.\n"); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CiNpbmNsdWRlIDxhc3NlcnQuaD4KCi8vIERlZmluZSB0aGUgbGFtYmRhIGZ1bmN0aW9ucyBhcyByZWd1bGFyIEMgZnVuY3Rpb25zCmludCBmKGludCBhLCBpbnQgYikgewogICAgcmV0dXJuICgoYiAtIGEgKyAwLjEpIC8gKGIgLSBhICsgMC4yKSk7Cn0KCmludCBteChpbnQgYSwgaW50IGIpIHsKICAgIHJldHVybiBmKGEsIGIpICogYSArIGYoYiwgYSkgKiBiICsgYSAqICgxIC0gZihhLCBiKSAtIGYoYiwgYSkpOwp9CgppbnQgbWFpbigpIHsKICAgIGZvciAoaW50IGkgPSAtMTA7IGkgPCAxMDsgaSsrKSB7CiAgICAgICAgZm9yIChpbnQgaiA9IC0xMDsgaiA8IDEwOyBqKyspIHsKICAgICAgICAgICAgaW50IHQxID0gbXgoaSwgaik7CiAgICAgICAgICAgIGludCB0MiA9IGkgPiBqID8gaSA6IGo7CiAgICAgICAgICAgIGFzc2VydCh0MSA9PSB0Mik7CiAgICAgICAgICAgIC8vIFVuY29tbWVudCB0aGUgbGluZSBiZWxvdyB0byBwcmludCBmKGksIGopIHZhbHVlcwogICAgICAgICAgICAvLyBwcmludGYoImYoJWQsICVkKSA9ICVmXG4iLCBpLCBqLCBmKGksIGopKTsKICAgICAgICB9CiAgICB9CiAgICBwcmludGYoIkFsbCBhc3NlcnRpb25zIHBhc3NlZC5cbiIpOwogICAgcmV0dXJuIDA7Cn0K