#P1749. Cookie Distribution Problem
Cookie Distribution Problem
Cookie Distribution Problem
A teacher has N cookies and wants to distribute them among k children such that each child receives at least one cookie and no two children receive the same number of cookies. In other words, all k numbers of cookies must be distinct.
Note that the minimum total number of cookies required is given by the formula: $$S=\frac{k(k+1)}{2}$$. Therefore, the teacher can achieve the goal if and only if N \ge S.
Your task is to determine whether it is possible to distribute N cookies among k children following the above conditions.
inputFormat
The input consists of a single line with two integers N and k separated by a space, where N is the total number of cookies and k is the number of children.
outputFormat
Output a single line containing YES
if it is possible to distribute the cookies according to the conditions, or NO
otherwise.
sample
6 3
YES