summaryrefslogtreecommitdiff
path: root/introductory_problems/readme.md
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-02-19 11:48:40 -0700
committerJack Sangdahl <[email protected]>2025-02-20 12:29:15 -0700
commit1bd17a77301438997ccc4e3eaf7ebe04474a5767 (patch)
treedb282449741ba5411368412bca03cd28786f02b8 /introductory_problems/readme.md
parentdcef6fef864949bcde09907c120180733e5d37bc (diff)
downloadcses-1bd17a77301438997ccc4e3eaf7ebe04474a5767.tar.gz
cses-1bd17a77301438997ccc4e3eaf7ebe04474a5767.zip
1623. apple division
Diffstat (limited to 'introductory_problems/readme.md')
-rw-r--r--introductory_problems/readme.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/introductory_problems/readme.md b/introductory_problems/readme.md
index 52a1f51..32519e6 100644
--- a/introductory_problems/readme.md
+++ b/introductory_problems/readme.md
@@ -112,3 +112,10 @@ The goal is to move all the disks to the right stack using the middle stack. On
**Input**: The only input line has an integer `n`: the number of disks. (Example: 2)
**Output**: First print an integer `k`: the minimum number of moves. After this, print `k` lines that describe the moves. Each line has two integers `a` and `b`: you move a distk from stack `a` to stack `b`. (Example: 3 12 13 23)
+
+### Apple Division
+There are `n` apples with known weights. Your task is to divide the apples into two groups so that the difference between the weights of the groups is minimal.
+
+**Input**: The first input line has an integer `n`: the number of apples. The next input line has `n` integers `p1, p2, ..., pn`: the weight of each apple. (Example: 5`\n`3 2 7 4 1)
+
+**Output**: Print one integer: the minimum difference between the weights of the groups. (Example: 1)