Problem:
Score : 200 points

Problem Statement

You are given a string S consisting of lowercase English letters.
We will write down this string, starting a new line after every w letters. Print the string obtained by concatenating the letters at the beginnings of these lines from top to bottom.

Constraints

1 \leq w \leq |S| \leq 1000

S consists of lowercase English letters.

w is an integer.

Input

Input is given from Standard Input in the following format:

S
w

Output

Print the desired string in one line.

Sample Input 1

abcdefgh
3

Sample Output 1

adg

When we write down abcdefgh, starting a new line after every three letters, we get the following:

abc

def

gh

Concatenating the letters at the beginnings of these lines, we obtain adg.

Sample Input 2

lllll
1

Sample Output 2

lllll

Sample Input 3

souuundhound
2

Sample Output 3

suudon

Solution in C# (.NET Core 3.1.201) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            ////入力した値を数値変換する
            string str = Console.ReadLine();
            int intNumFirst = int.Parse(Console.ReadLine());

            string[] strArray = new string[str.Length];

            //1文字目の文字を取得する
            char c1 = str[0];
            //あ

            //forを使って1文字ずつ列挙する
            for (int i = 0; i < str.Length; i++)
            {
                strArray[i] = str[i].ToString(); ;
            }

            int intMax = strArray.Length;
            string strResult = string.Empty;

            for (int i=0;i< intMax;i=i+intNumFirst)
            {
                strResult = strResult + strArray[i];
            }

            Console.WriteLine(strResult);

        }
    }

}