private static void GetInputData()
        {
            int count = int.Parse(Console.ReadLine()
                .Split(' ')[1]);

            tasks = new Task[count];
            for (int i = 1; i <= count; i++)
            {
                int[] tokens = Console.ReadLine()
                    .Split(new[] { ' ', '-' }, StringSplitOptions.RemoveEmptyEntries)
                    .Select(int.Parse)
                    .ToArray();

                tasks[i - 1] = new Task { Index = i, Value = tokens[0], Deadline = tokens[1] };
            }
        }
        static bool ValidateTask(List<Task> tasks, Task task)
        {
            var tempTasks = new List<Task> { task };
            tempTasks.AddRange(tasks);
            var tempTaskList = tempTasks
                .OrderBy(t => t.Deadline);

            int step = 1;
            foreach (var t in tempTaskList)
            {
                if (step > t.Deadline)
                {
                    return false;
                }

                step++;
            }

            return true;
        }