← All problemsSign in

Apples and Bananas

CSESAdvanced TechniquesOpen on judge ↗

There are n apples and m bananas, and each of them has an integer weight between 1 \ldots k. Your task is to calculate, for each weight w between 2 \dots 2k, the number of ways we can choose an apple and a banana whose combined weight is w. Input The first input line contains three integers k, n and m: the number k, the number of apples and the number of bananas. The next line contains n intege

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start