<?php
200,
200,
100
);
function doApple($n, $array)
{
$half = $summary / 2;
$half2 = $half;
$summary_mass = 0;
foreach ($apples2 as $mass => &$count) {
if ($count != 0) {
$arg = floor($half / $mass); $arg = min ($arg, $count); $half -= $arg * $mass;
$count -= $arg;
$summary_mass += $arg * $mass;
}
}
if ($summary_mass == $half2) {
return "Yes\n";
} else {
return "No\n";
}
}
echo doApple(3, $apples);
PD9waHAKbWJfaW50ZXJuYWxfZW5jb2RpbmcoIlVURi04Iik7CiRhcHBsZXMgPSBhcnJheSgKICAgIDIwMCwKICAgIDIwMCwKICAgIDEwMAogICAgCiAgICAKICAgIAopOwpmdW5jdGlvbiBkb0FwcGxlKCRuLCAkYXJyYXkpCnsKICAgIAogICAgJHN1bW1hcnkgICAgICA9IGFycmF5X3N1bSgkYXJyYXkpOwogICAgJGhhbGYgICAgICAgICA9ICRzdW1tYXJ5IC8gMjsKICAgICRoYWxmMiAgICAgICAgPSAkaGFsZjsKICAgICRhcHBsZXMyICAgICAgPSBhcnJheSgpOwogICAgJGFwcGxlczIgICAgICA9IGFycmF5X2NvdW50X3ZhbHVlcygkYXJyYXkpOwogICAgJHN1bW1hcnlfbWFzcyA9IDA7CiAgICBmb3JlYWNoICgkYXBwbGVzMiBhcyAkbWFzcyA9PiAmJGNvdW50KSB7CiAgICAgICAgaWYgKCRjb3VudCAhPSAwKSB7CiAgICAgICAgICAgIAogICAgICAgICAgICAkYXJnID0gZmxvb3IoJGhhbGYgLyAkbWFzcyk7CiAgICAgICAgICAgICRhcmcgPSBtaW4gKCRhcmcsICRjb3VudCk7CiAgICAgICAgICAgICRoYWxmIC09ICRhcmcgKiAkbWFzczsKICAgICAgICAgICAgJGNvdW50IC09ICRhcmc7CiAgICAgICAgICAgICRzdW1tYXJ5X21hc3MgKz0gJGFyZyAqICRtYXNzOwogICAgICAgICAgICAKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgCiAgICB9CiAgICBpZiAoJHN1bW1hcnlfbWFzcyA9PSAkaGFsZjIpIHsKICAgICAgICByZXR1cm4gIlllc1xuIjsKICAgIH0gZWxzZSB7CiAgICAgICAgcmV0dXJuICJOb1xuIjsKICAgIH0KICAgIAogICAgCn0KZWNobyBkb0FwcGxlKDMsICRhcHBsZXMpOw==