Editorial for Алмаларды бөлу -2
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Hint 1.
Бұл есепте алмаларды \(N\) оқушыға тең бөлу керек. Бізге әр оқушыға қанша тиетіні емес, қалған алмалардың саны керек.
Hint 2.
Қалдықты табу үшін бүтін бөлудің қалдығын қолданамыз:
\(K \bmod N\)
Hint 3.
Мысалы, \(K = 14\), \(N = 4\):
\(14 \bmod 4 = 2\)
Демек, себетте \(2\) алма қалады.