Created
April 6, 2019 14:05
-
-
Save whatalnk/c5051e8b977e0d0157fbd70b2f5940e2 to your computer and use it in GitHub Desktop.
AtCoder ABC #123 C - Five Transportations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = gets.chomp.to_i | |
a = [] | |
5.times do | |
a << gets.chomp.to_i | |
end | |
amin = a.min | |
r = n % amin | |
g = n / amin | |
g += 1 if r > 0 | |
puts 5 + g - 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment