Editorial for 2159: Матричка
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.
Автор, розробник, автор розбору: Iлля Пермяков
Оскiльки антидiагоналi у прямокутнику не перетинаються, то кожна клiтина належить рiвно однiй антидiагоналi. Тому мiнiмальна кiлькiсть клiтин, яку потрiбно зафарбувати, дорiвнює кiлькостi антидiагоналей у прямокутнику: ~n + m-1~.
Отже, вiдповiдь iснує, коли ~k >= n + m-1~.
n, m, k = map(int, input().split()) if n + m - 1 <= k: print("YES") else: print("NO")
Коментарі