Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created September 23, 2017 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/5c1644693a42872d47b98a137e04e1e4 to your computer and use it in GitHub Desktop.
Save whatalnk/5c1644693a42872d47b98a137e04e1e4 to your computer and use it in GitHub Desktop.
Code Festival 2017 Qual A
s = gets.chomp
if s[0..3] == "YAKI" then
puts "Yes"
else
puts "No"
end
n, m, k = gets.chomp.split(" ").map(&:to_i)
black = []
(0..n).each do |i|
(0..m).each do |j|
cnt = i * m + j * n - i * j * 2
black << cnt
end
end
if black.include?(k) then
puts "Yes"
else
puts "No"
end
@whatalnk
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment