<?php
// [[$a, $b, $c], $expected]
$tests = [
[[1, 2, 3], false], // a < b < c, erro!
[[1, 3, 2], false], // a < b > c, erro!
[[2, 1, 3], false], // a > b < c, erro!
[[3, 2, 1], true], // a > b > c, ok!
[[1, 1, 1], false], // a = b = c, erro!
[[2, 2, 1], false], // a = b > c, erro!
[[2, 1, 1], false], // a > b = c, erro!
[[2, 1, 2], false] // a > b < c, erro!
];
foreach($tests as $i => $test)
{
list($curva_a, $curva_b, $curva_c) = $test[0]; $expected = $test[1];
assert(($curva_a <= $curva_b || $curva_b <= $curva_c) == !$expected, "Erro no teste {$i}"); }
PD9waHAKCi8vIFtbJGEsICRiLCAkY10sICRleHBlY3RlZF0KJHRlc3RzID0gWwogIFtbMSwgMiwgM10sIGZhbHNlXSwgLy8gYSA8IGIgPCBjLCBlcnJvIQogIFtbMSwgMywgMl0sIGZhbHNlXSwgLy8gYSA8IGIgPiBjLCBlcnJvIQogIFtbMiwgMSwgM10sIGZhbHNlXSwgLy8gYSA+IGIgPCBjLCBlcnJvIQogIFtbMywgMiwgMV0sIHRydWVdLCAgLy8gYSA+IGIgPiBjLCBvayEKICBbWzEsIDEsIDFdLCBmYWxzZV0sIC8vIGEgPSBiID0gYywgZXJybyEKICBbWzIsIDIsIDFdLCBmYWxzZV0sIC8vIGEgPSBiID4gYywgZXJybyEKICBbWzIsIDEsIDFdLCBmYWxzZV0sIC8vIGEgPiBiID0gYywgZXJybyEKICBbWzIsIDEsIDJdLCBmYWxzZV0gIC8vIGEgPiBiIDwgYywgZXJybyEKXTsKCmZvcmVhY2goJHRlc3RzIGFzICRpID0+ICR0ZXN0KQp7CiAgbGlzdCgkY3VydmFfYSwgJGN1cnZhX2IsICRjdXJ2YV9jKSA9ICR0ZXN0WzBdOwogICRleHBlY3RlZCA9ICR0ZXN0WzFdOwogIAogIGFzc2VydCgoJGN1cnZhX2EgPD0gJGN1cnZhX2IgfHwgJGN1cnZhX2IgPD0gJGN1cnZhX2MpID09ICEkZXhwZWN0ZWQsICJFcnJvIG5vIHRlc3RlIHskaX0iKTsKfQ==