Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Configuration;
  4. using System.Linq;
  5. using System.Runtime.Serialization;
  6. using System.Text.RegularExpressions;
  7.  
  8. namespace ChechPrime
  9. {
  10.     public class Program
  11.     {
  12.         static void Main()
  13.         {
  14.             List<int> numbers = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  15.             int[] nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  16.             List<int> takenNums = new List<int>();
  17.             takenNums = numbers;
  18.  
  19.             for (int i = 0; i < nums[0]; i++)
  20.             {
  21.                 while (nums[1] > 0)
  22.                 {
  23.                     nums[1]--;
  24.                     takenNums.RemoveAt(0);
  25.                 }
  26.             }
  27.             if (takenNums.Contains(nums[2]))
  28.             {
  29.                 Console.WriteLine("YES!");
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine("NO!");
  34.             }
  35.  
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement