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



Sample input:
abcdefgh
3


Sample output:
adg

Submission status: Wrong Answer

Solution code:
S = input()
w = int(input())
for i in range(len(S)):
  if w != 1 and (i + 1) % w == 1 :
    print(S[i], end = "")
  elif w == 1:
    print(S[i])

Submission status: Wrong Answer

Solution code:
S = input()
w = int(input())
for i in range(len(S)):
  if (i + 1) % w == 1:
    print(S[i], end = "")

Submission status: Wrong Answer

Solution code:
print(input()[::3])

Submission status: Wrong Answer

Solution code:
s = input()
w = int(input())
ans = []
for i in range(len(s)//w):
  ans.append(s[w*i])
print("".join(ans))

Submission status: Wrong Answer

Solution code:
S=input()
w=int(input())
Sdash=[]
a=''
for i in range(0,len(S)//w):
    Sdash.append(S[w*i:w*(i+1)])
if len(S)%w!=0:
    Sdash.append(S[len(S)-w+1:])
for i in range(len(Sdash)):
    a+=Sdash[i][0]
print(a)

Submission status: Wrong Answer

Solution code:
s = input()
step = int(input())
for i in range(0, len(s), step):
  print(s[i])

Submission status: Wrong Answer

Solution code:
print(input()[::2])

Submission status: Wrong Answer

Solution code:
# B - Acrostic
# https://atcoder.jp/contests/soundhound2018-summer-qual/tasks/soundhound2018_summer_qual_b

# 指定した文字数ずつ分割　chunk

S = input()
w = int(input())

sp = [S[i: i+w] for i in range(0, len(S), w)]

for s in sp:
  print(s)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

S=S()
w=I()
print(S[::2])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

S=S()
w=I()
print(*list(S[::2]))

Submission status: Wrong Answer

Solution code:
s=input()
w=int(input())
ans=""
for i in range(-len(s)//-w):
    ans+=s[i*w]
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
w = int(input())
a = ''
for i in range(int(len(s)/w)):
  a += s[i*w]
print(a)

Submission status: Wrong Answer

Solution code:
s = input()
n = int(input())
print(s[0::3])

Submission status: Wrong Answer

Solution code:
s = '_' + input()
w = int(input())
ans = ''
for i in range(len(s)):
    if i%w==1:
        ans += s[i]
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
N = int(input())
while len(s):
    print(s[0:min(len(s), N)])
    s = s[min(len(s), N):]

Submission status: Wrong Answer

Solution code:
s = list(input())
w = int(input())
index = 0
l = []
while index <= len(s) - 1:
  print(index)
  l.append(s[index])
  index += w
print(*l, sep="")

Submission status: Wrong Answer

Solution code:
s = input()
w = int(input())
ans = ""
for i in range(len(s) // w):
    ans = ans + s[i * w]

print(ans)

Submission status: Wrong Answer

Solution code:

strings=[input() for string in range(2)]
string=strings[0]
num=int(strings[1])
i=0
check=True

while check:
    s=string[i:i+num]
    if len(s)<num:
        check=False
    print(s)
    i=i+num

Submission status: Wrong Answer

Solution code:
s = list(input())
ans =[]

for i in range(len(s)):
    if i%3 == 0:
        ans.append(s[i])
        
print("".join(ans))

Submission status: Wrong Answer

Solution code:
s=list(input())
w=int(input())
x=[]
y=''
ans=''
count=[]
for i in range(len(s)):
    y+=s[i]
    if len(list(y))==w:
        x.append(y)
        y=''
    if i==len(s)-1:
        x.append(y)
for j in range(len(x)-1):
    count=list(x[j])
    ans+=count[0]
print(ans)

Submission status: Wrong Answer

Solution code:
S,w=input(),int(input())
print(S[0::3])

Submission status: Wrong Answer

Solution code:
s=input()
d=""
n=int(input())
for i in range((len(s)+2)//3):
	d+=s[i*3]
print(d)

Submission status: Wrong Answer

Solution code:
s=input()
n=int(input())
ans=''
for i in range(n):
  if i%n==0:
    ans+=s[i]
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
moji=stdin.readline().rstrip()
N=int(stdin.readline().rstrip())
ite=(len(moji)//N)
ans=moji[0]
for i in range(1,ite):
    ans=ans+moji[i*N]
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
w=int(input())
a=[]
for i in range(len(s)):
  if (i+1)%w==1:a.append(s[i])
print(''.join(a))

Submission status: Wrong Answer

Solution code:
S = input()
w = int(input())

L = (len(S) // w)

moji = str()

for i in range(L):
    moji = moji + S[(i + 1)* w - 2]

print(moji)

Submission status: Wrong Answer

Solution code:
S = input()
w = int(input())

for index, s in enumerate(S):
    if index % w == 0:
        print(s)

Submission status: Wrong Answer

Solution code:
s = input()
w = int(input())

length = len(s)

output = s[0]
i = w

while(i<length):
    output += s[w]
    i += w

print(output)

Submission status: Wrong Answer

Solution code:
s=input()
x=''
for i in range(len(s)):
        if i%3==0:
                x+=s[i]
print(x)

Submission status: Wrong Answer

Solution code:
st = input()
skpe = int(input())
st_len = len(st)
count = st_len // 3  + 1
top_list = []

for i in range(count):
    top_list.append(st[3 * i:3 * i + 3])


for x in top_list:
    try:
        print(x[0], end="")
    except IndexError:
        pass

Submission status: Wrong Answer

Solution code:
S = input()
w = int(input())
stack = []
for x in range(len(S)//w):
    stack.append(S[x*w])
print("".join(stack))

Submission status: Wrong Answer

Solution code:
s=input()
w=int(input())
for i in range(len(s)//w):
    print(s[i*w],end='')

Submission status: Wrong Answer

Solution code:
from sys import stdin
a = stdin.readline().strip()
n  = int(stdin.readline())
ans = ''
m = len(a)
for  i in xrange(m):
 if i%m==0:
  ans += a[i]
print ans

Submission status: Wrong Answer

Solution code:
def output(string, digit):
    _output=""
    for i in range(len(string)):
        if i%digit==0:
            _output=_output+string[i]
        else: pass
    return _output

s=str(input())
d=int(input())
output(s, d)

Submission status: Wrong Answer

Solution code:
def output(string, digit):
    _output=""
    for i in range(len(string)):
        if i%digit==0:
            _output= _output+string[i]
        else: pass
    return _output

s=input()
d=int(input())
output(s, d)

Submission status: Wrong Answer

Solution code:
def main():
    s_i = input()
    n_i = int(input())
    ans = ""
    while True:
        if len(s_i) < n_i:
            if s_i != "":
               ans += s_i[0] 
            else:
                break
        else:
            ans += s_i[:n_i][0]
            s_i = s_i[n_i:]
            print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    s_i = input()
    n_i = int(input())
    ans = ""
    while True:
        if len(s_i) < n_i:
            if n_i == 1:
                break
            else:
                if s_i == "":
                    break
                else:
                    ans += s_i[0]
                    break
        else:
            ans += s_i[:n_i][0]
            s_i = s_i[n_i:]
            print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
S = input()
lisS= list(S)
lens = len(lisS)
#print(lens)
w = int(input())

wlis = []
k = 1
while k <= math.floor(lens/w):
    if w*k <= lens:
        #print(w*k)
        wlis.append(w*k)
        k += 1
    else:
        break
#print(wlis)

toprint = []
toprint.append(lisS[0])
pr = 0
while pr in range(len(wlis)-1):
    toprint.append(lisS[wlis[pr]])
    pr += 1
#print(toprint)
data_str = ",".join(toprint) # aaa,bbb,ccc
#print(data_str)
new =data_str.replace(',', '')
print(new)

Submission status: Wrong Answer

Solution code:
S = list(input())
w = int(input())

L = len(S)

ans = []

for i in range(0,L,w):
	if i < L-1:
		ans.append(S[i])


print (''.join(ans))

Submission status: Wrong Answer

Solution code:
S = input()
lisS= list(S)
lens = len(lisS)
#print(lens)
w = int(input())

wlis = []
k = 1
while k <= lens/w:
    if w*k <= lens:
        #print(w*k)
        wlis.append(w*k)
        k += 1
    else:
        break
#print(wlis)

toprint = []
toprint.append(lisS[0])
pr = 0
while pr in range(len(wlis)-1):
    toprint.append(lisS[wlis[pr]])
    pr += 1
#print(toprint)
data_str = ",".join(toprint) # aaa,bbb,ccc
#print(data_str)
new =data_str.replace(',', '')
print(new)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
S = input()
w = int(input())
x = 0

S_list = list(S)

while True:
    sys.stdout.write(S_list[x])
    x = x + w
    if x > len(S_list) or x + w > len(S_list):
        break

Submission status: Wrong Answer

Solution code:
S = input()
w = int(input())
s = ''
for i in range(len(S)//w):
    s += S[w * i]
print(s)

Submission status: Wrong Answer

Solution code:
x =raw_input()
b = raw_input()

num = int(b)

y = list(x)

z=[]

if (len(y)%num) ==0:
    numy = len(y)/num
else:
    numy = len(y)/num+1

for i in range(numy):
    z.append( y[i*num])

print z

Submission status: Wrong Answer

Solution code:
s=input()
w=int(input())
a=''
for i in range(0,len(s)//w):
    a+=s[w*i]
print(a)

Submission status: Wrong Answer

Solution code:

line = input()
w = int(input())

length = len(line)

out = ""

for i in range(len(line) // w):
    out += line[i*w]

print(out)

Submission status: Wrong Answer

Solution code:
S = input()
N = int(input())

output=[]

print(len(S))

for i in range(len(S)):
  if i%N==0:
    output.append(S[i])
    
output2 = ''.join(output)

print(output2)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

s = input()
n = int(input())
lens = len(s)

if lens % n != 0:
    lens += 1
    
string = ""
for i in range(lens // n):
    string += s[i*n]

print(string)

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
print(a[::3])

Submission status: Wrong Answer

Solution code:
s=input()
w=int(input())
ans=s[0]
for i in range(1,len(s)//w):
	ans+=s[i*w]
print(ans)

Submission status: Wrong Answer

Solution code:
a=input().strip()
print(a[::3])

Submission status: Wrong Answer

Solution code:
s, w =input(), int(input())
ans = ''
c = 0
while c < len(s)-1:
    ans += s[c]
    c += w
print(ans)

Submission status: Accepted

Solution code:
s = input()
w = int(input())
n = len(s)

res = []
m = n // w
for i in range(m + 1):
    if w*i >= n: continue
    res.append(s[w*i])

print(''.join(res))

Submission status: Accepted

Solution code:
S = input()
w = int(input())

print(S[::w])

Submission status: Accepted

Solution code:
S,W = (input() for T in range(0,2))
print(''.join(S[TW] for TW in range(0,len(S),int(W))))

Submission status: Accepted

Solution code:
print(input()[::int(input())])

Submission status: Accepted

Solution code:
S = input()
w = int(input())
for i in range(len(S)):
  if w != 1 and (i + 1) % w == 1 :
    print(S[i], end = "")
  elif w == 1:
    print(S[i], end = "")

Submission status: Accepted

Solution code:
S = input()
w = int(input())
ans = ""
i = 0
while i < len(S):
  ans += S[i]
  i += w
print(ans)

Submission status: Accepted

Solution code:
S = input()
w = int(input())
print(S[::w])

Submission status: Accepted

Solution code:
S = input()
w = int(input())
if len(S) % w == 0:
    r = len(S) // w
else:
    r = len(S) // w + 1
for i in range(r):
    print(S[i * w], end='')

Submission status: Accepted

Solution code:
s=input()
w=int(input())

print(s[0:len(s):w])

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = []
if len(s)%w == 0:
  for i in range(len(s)//w):
    ans.append(s[w*i])
else:
  for i in range(len(s)//w+1):
    ans.append(s[w*i])
print("".join(ans))

Submission status: Accepted

Solution code:
s=input()
n=int(input())
k=len(s)
ans=""
for i in range(k):
  if i % n==0:
    ans+=s[i]
print(ans)

Submission status: Accepted

Solution code:
import math
s = input()
n = int(input())
news = ""
c = math.ceil(len(s)/n)
for i in range(c):
    news += s[(i)*n]
print(news)

Submission status: Accepted

Solution code:
s=input()
w=int(input())
print(s[::w])

Submission status: Accepted

Solution code:
s = str(input())
w = int(input())
word = "".join(s[h] for h in range(0,len(s),w))
print(word)

Submission status: Accepted

Solution code:
s =input()
w = int(input())
i = 0
while(i<len(s)):
  print(s[i],end="")
  i = i+w

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = ""
for i in range(0, len(s), w):
  ans += s[i]
print(ans)

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = ''
for i in range(0, len(s), w):
    ans += s[i]
print(ans)

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')
    w = int(input())
    print(S[::w])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
n = int(input())

i = 0
while i*n < len(s):
    print(s[i*n],end = "")
    i +=1

Submission status: Accepted

Solution code:
s = input()
n = int(input())
a=''
for i in range(len(s)):
  if i%n==0:
    a+=s[i]
print(a)

Submission status: Accepted

Solution code:
s = input()
n = int(input())

ans = ""
for i in range(len(s)):
  if i % n == 0:
    ans += s[i]
    
print(ans)

Submission status: Accepted

Solution code:
S=input()
w=int(input())
print(S[::w])

Submission status: Accepted

Solution code:
def main():
    s = input()
    w = int(input())

    print(s[::w])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    S = input()
    w = int(input())
    ans = ""
    for i in range(0, len(S), w):
        ans += S[i]
    print(ans)


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    w = int(readline())

    print(S[::w])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# SoundHound Inc. Programming Contest 2018 -Masters Tournament-: B – Acrostic
S = input()
w = int(input())

word = ''

for i in range(0, len(S), w):
    word += S[i]

print(word)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
s = S()
w = I()
ans = s[::w]
print(ans)

Submission status: Accepted

Solution code:
S=input()
W=int(input())
print(S[::W])

Submission status: Accepted

Solution code:
s = input()
w = int(input())
print(s[::w])

Submission status: Accepted

Solution code:
S=input()
w=int(input())
ans=''
for i in range(0,len(S),w):
    ans+=S[i]
print(ans)

Submission status: Accepted

Solution code:
from math import ceil
s = list(input())
w = int(input())
for i in range(ceil(len(s)/w)):
    print(s[i*w],end="")

Submission status: Accepted

Solution code:
S = input()
W = int(input())
for i in range(len(S)):
  if i%W == 0:
    print(S[i],end ='')

Submission status: Accepted

Solution code:
S=input()
w=int(input())
n=len(S)
T=""
for i in range (0,n,w):
  T+=S[i]
print(T)

Submission status: Accepted

Solution code:
s=input()
n = int(input())

ans=[s[i] for i in range(len(s)) if i%n==0]

print(''.join(ans))

Submission status: Accepted

Solution code:
import sys, math
from collections import deque

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    S = input()
    w = ii()
    print(*S[::w], sep='')
        

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = ""
for i in range(len(s)):
    if i % w == 0:
        ans += s[i]
print(ans)

Submission status: Accepted

Solution code:
import math

s = input()
w = int(input())

num_words = math.ceil(len(s)/w)
letters = []
for i in range(num_words):
    letter = s[i*w]
    letters.append(letter)

ans = ''.join(letters)
print(ans)

Submission status: Accepted

Solution code:
S=input()
w=int(input())
Sdash=[]
a=''
for i in range(0,len(S)//w):
    Sdash.append(S[w*i:w*(i+1)])
if len(S)%w!=0:
    Sdash.append(S[((len(S)//w)*w):])
for i in range(len(Sdash)):
    a+=Sdash[i][0]
print(a)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
n = ri()
print(s[::n])

Submission status: Accepted

Solution code:
S = str(input())
w = int(input())
idx = 0
ans = ""
while idx < len(S):
  ans += S[idx]
  idx += w
print(ans)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S = SS()
    w = I()

    ans = [S[i] for i in range(0, len(S), w)]
    print(''.join(ans)) 

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
S=input()
w=int(input())

Q=''
import math
for i in range(math.ceil(len(S)/w)):
    Q+=S[i*w]
print(Q)

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = ''
for i in range(len(s))[::w]:
    ans += s[i]

print(ans)

Submission status: Accepted

Solution code:
print(input()[0::int(input())])

Submission status: Accepted

Solution code:
def main():
    s = input()
    w = int(input())
    print(s[0::w])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
w=int(input())
print(s[0::w])

Submission status: Accepted

Solution code:
S = input()
W = int(input())
res = ''
for i in range((len(S) + W - 1) // W):
    res = ''.join((res, S[W * i]))
print(res)

Submission status: Accepted

Solution code:
s = input()
w = int(input())
a = ""
b = 0
c = 0
if len(s) % w == 0:
  c = len(s)//w
else:
  c = (len(s)//w)+1
for i in range(c):
  a = a + s[b]
  b = b + w
print(a)

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = ""

for i in range(0, len(s), w):
    ans += s[i]

print(ans)

Submission status: Accepted

Solution code:
s = input()
step = int(input())
print(''.join([s[i] for i in range(0, len(s), step)]))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = readline().decode('utf-8').strip()
    w = int(readline())
    ans = ''
    for i in range(0, len(S), w):
        ans += S[i]
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=list(input())
w=int(input())
print(''.join([x for i,x in enumerate(s) if i%w==0]))

Submission status: Accepted

Solution code:
S = input()
w = int(input())

t = ''
for i in range(0, len(S), w):
    t+=S[i]
print(t)

Submission status: Accepted

Solution code:
s = input()
n = int(input())

ans = ''
for i in range(len(s)):
  if i%n == 0:
    ans += s[i]
print (ans)

Submission status: Accepted

Solution code:
S = input()
k = int(input())
print(S[::k])

Submission status: Accepted

Solution code:
a=input()
n=int(input())
print(a[::n])

Submission status: Accepted

Solution code:
S=input()
w=int(input())
ans=[]
for i in range(0,len(S),w):
  ans.append(S[i])
print("".join(ans))

Submission status: Accepted

Solution code:
import math

s = input()
w = int(input())
for i in range(math.ceil(len(s) / w)):
    print(s[i * w],end="")
print("")

Submission status: Accepted

Solution code:
S = input()
w = int(input())

ans = ""
for i in range(0,len(S),w):
  ans += S[i]
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
#N, m, d = map(int,input().split())
#N = int(input())
s = input()
#s = list(map(str,input().split()))
#a, b = map(int,input().split())
#P = list(map(int,input().split()))
w = int(input())
ans = ""
if w==1:
    ans = s
else:
    for i in range(len(s)):
        if (i+1)%w==1:
            ans += s[i]
    
print(ans)

Submission status: Accepted

Solution code:
S=list(input())
w=int(input())

answer_list=[]
for i in range(0,len(S),w):
  #print(S[i])
  answer_list.append(S[i])
  
print("".join(answer_list))

Submission status: Accepted

Solution code:
s = input()
w = int(input())
n = len(s)
ans = ""
i = 0
while i < n:
    ans += s[i]
    i += w
print(ans)

Submission status: Accepted

Solution code:
s = str(input())
n = int(input())
if len(s)%n == 0:
    cnt = len(s)//n
else:
    cnt = len(s)//n + 1
ans = []
for i in range(cnt):
    ans.append(s[i*n])
print(*ans, sep = "")

Submission status: Accepted

Solution code:
s = input()
w = int(input())
print(s[::w])

Submission status: Accepted

Solution code:
S = input()
w = int(input())

print(*S[::w], sep="")