Created
April 6, 2019 14:07
-
-
Save whatalnk/0d15a0563f4b76668c3355a4861b1347 to your computer and use it in GitHub Desktop.
AtCoder ABC #123 A - Five Antennas
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
pos = [] | |
5.times do | |
pos << gets.chomp.to_i | |
end | |
k = gets.chomp.to_i | |
pos.combination(2) do |a, b| | |
if (a - b).abs > k | |
puts ":(" | |
exit | |
end | |
end | |
puts "Yay!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment