eolymp
bolt
Try our new interface for solving problems
Məsələlər

Cinderella

Cinderella

Cinderella is given a task by her Stepmother before she is allowed to go to the Ball. There are \textbf{N} (\textbf{1} ≤ \textbf{N} ≤ \textbf{1000}) bottles with water in the kitchen. Each bottle contains \textbf{L_i} (\textbf{0} ≤ \textbf{L_i} ≤ \textbf{10^6}) ounces of water and the maximum capacity of each is \textbf{10^9} ounces. To complete the task Cinderella has to pour the water between the bottles to fill them at equal measure. Cinderella asks Fairy godmother to help her. At each turn Cinderella points out one of the bottles. This is the source bottle. Then she selects any number of other bottles and for each bottle specifies the amount of water to be poured from the source bottle to it. Then Fairy godmother performs the transfusion instantly. Please calculate how many turns Cinderella needs to complete the Stepmother’s task. \InputFile The first line of input contains an integer number \textbf{N} (\textbf{1} ≤ \textbf{N} ≤ \textbf{1000}) --- the total number of bottles. On the next line integer numbers Li are contained (\textbf{0} ≤ \textbf{L_i} ≤ \textbf{10^6}) --- the initial amount of water contained in ith bottle. \OutputFile Output a single line with an integer \textbf{S} --- the minimal number of turns Cinderella needs to complete her task.
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 256 MiB
Giriş verilənləri #1
3
5 7 7
Çıxış verilənləri #1
2
Mənbə ACM ICPC 2012-2013, NEERC, Moscow Subregion, Moscow, Sunday, October 21, 2012