| 1 |
/*** |
| 2 |
!Test |
| 3 |
expected: !Result |
| 4 |
solution: !Solution |
| 5 |
addn: [0, -2, -1, 0, 1, 2, -2, -4, -3, -2, -1, 0, -1, -3, -2, -1, 0, 1, 0, -2, -1, 0, 1, 2, 1, -1, 0, 1, 2, 3, 2, 0, 1, 2, 3, 4] |
| 6 |
subn: [null, null, null, null, null, null, -2, 0, -1, -2, -3, -4, -1, 1, 0, -1, -2, -3, 0, 2, 1, 0, -1, -2, 1, 3, 2, 1, 0, -1, 2, 4, 3, 2, 1, 0] |
| 7 |
prod: [1, -2, -1, 0, 1, 2, -2, 4, 2, 0, -2, -4, -1, 2, 1, 0, -1, -2, 0, 0, 0, 0, 0, 0, 1, -2, -1, 0, 1, 2, 2, -4, -2, 0, 2, 4] |
| 8 |
divn: [null, null, null, null, null, -2, 1, 2, -2, -1, -1, 0, 1, -1, 0, 1, 0, -1, 1, 0, 2, -1, -2, 2, 1] |
| 9 |
gt: [true, true, true, true, false, false, true, true, false] |
| 10 |
ge: [true, true, true, true, true, false, true, true, true] |
| 11 |
lt: [true, true, true, true, false, true, true, false, false] |
| 12 |
le: [true, true, true, true, true, true, true, false, true] |
| 13 |
status: SATISFIED |
| 14 |
***/ |
| 15 |
|
| 16 |
array [1..36] of int: addn :: add_to_output = [x + y | x, y in [<>, -2, -1, 0, 1, 2]]; |
| 17 |
array [1..36] of opt int: subn :: add_to_output = [x - y | x, y in [<>, -2, -1, 0, 1, 2]]; |
| 18 |
array [1..36] of int: prod :: add_to_output = [x * y | x, y in [<>, -2, -1, 0, 1, 2]]; |
| 19 |
array [1..25] of opt int: divn :: add_to_output = [x div y | x, y in [<>, -2, -1, 1, 2]]; |
| 20 |
|
| 21 |
array [1..9] of bool: gt :: add_to_output = [ x > y | x, y in [<>, 0, 1]]; |
| 22 |
array [1..9] of bool: ge :: add_to_output = [ x >= y | x, y in [<>, 0, 1]]; |
| 23 |
array [1..9] of bool: lt :: add_to_output = [ x < y | x, y in [<>, 0, 1]]; |
| 24 |
array [1..9] of bool: le :: add_to_output = [ x <= y | x, y in [<>, 0, 1]]; |
| 25 |
|
| 26 |
solve satisfy; |