using System; namespace StudyApp { class Program { static void Main(string[] args) { string input = Console.ReadLine(); CanSleep(double.Parse(input)); } public static void CanSleep(double target_num) { double second = 0; // Total seconds double sheep_num = 0; // The number of sheep while (true) { sheep_num += second; if (target_num > sheep_num) second++; else break; } if (target_num.Equals(sheep_num)) { Console.WriteLine("YES"); Console.WriteLine(second); } else { Console.WriteLine("NO"); } } } }