#include <stdio.h>
int main() {
int x, y; // リンゴの個数(x)、モモの個数(y)
int total_price = 2080; // 合計金額
int total_items = 8; // 合計個数
int price_apple = 230; // リンゴの価格
int price_peach = 310; // モモの価格
// 連立方程式を解く
for (x = 0; x <= total_items; x++) {
y = total_items - x; // モモの個数は (8 - x)
if ((price_apple * x + price_peach * y) == total_price) {
return 0;
}
}
// 解が見つからない場合
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCB4LCB5OyAvLyDjg6rjg7PjgrTjga7lgIvmlbAoeCnjgIHjg6Ljg6Ljga7lgIvmlbAoeSkKICAgIGludCB0b3RhbF9wcmljZSA9IDIwODA7IC8vIOWQiOioiOmHkemhjQogICAgaW50IHRvdGFsX2l0ZW1zID0gODsgICAgLy8g5ZCI6KiI5YCL5pWwCiAgICBpbnQgcHJpY2VfYXBwbGUgPSAyMzA7ICAvLyDjg6rjg7PjgrTjga7kvqHmoLwKICAgIGludCBwcmljZV9wZWFjaCA9IDMxMDsgIC8vIOODouODouOBruS+oeagvAoKICAgIC8vIOmAo+eri+aWueeoi+W8j+OCkuino+OBjwogICAgZm9yICh4ID0gMDsgeCA8PSB0b3RhbF9pdGVtczsgeCsrKSB7CiAgICAgICAgeSA9IHRvdGFsX2l0ZW1zIC0geDsgLy8g44Oi44Oi44Gu5YCL5pWw44GvICg4IC0geCkKICAgICAgICBpZiAoKHByaWNlX2FwcGxlICogeCArIHByaWNlX3BlYWNoICogeSkgPT0gdG90YWxfcHJpY2UpIHsKICAgICAgICAgICAgcHJpbnRmKCLjg6rjg7PjgrTjga7lgIvmlbA6ICVkIOWAi1xuIiwgeCk7CiAgICAgICAgICAgIHByaW50Zigi44Oi44Oi44Gu5YCL5pWwOiAlZCDlgItcbiIsIHkpOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICB9CgogICAgLy8g6Kej44GM6KaL44Gk44GL44KJ44Gq44GE5aC05ZCICiAgICBwcmludGYoIuino+OBjOimi+OBpOOBi+OCiuOBvuOBm+OCk+OAglxuIik7CiAgICByZXR1cm4gMDsKfQo=