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