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: Accepted

Solution code:
#!/usr/bin/env python3

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    s = input()
    w = ii()
    ans = []
    for i in range(len(s)):
        if i % w == 0:
            ans.append(s[i])
    print(''.join(ans))
        


if __name__ == "__main__":
    main()

Submission status: Accepted

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

for x in range(len(S)):
  if x%w==0:
    ans += S[x]
print(ans)

Submission status: Accepted

Solution code:
s = list(str(input()))
w = int(input())
ans = ''
for i, c in enumerate(s):
    if i%w == 0:
        ans += c
print(ans)

Submission status: Accepted

Solution code:
s=str(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 sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

s=s()
w = k()
a = []
for i in range(0,len(s),w):
    a.append(s[i])
print("".join(a))

Submission status: Accepted

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

ans = S[::w]
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    S = input()
    w = int(input())
    ans = []
    for i in range(0,len(S),w):
        ans.append(S[i])
    print(''.join(ans))
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=S[0]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(s))[::w]:
    t.append(s[i])

print(''.join(t))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    w = int(input())
    print(S[::w])
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    S=input()
    w=I()
    ans=[]
    for i in range(0,len(S),w):
        ans.append(S[i])
        
    print(''.join(map(str,ans)))

main()

Submission status: Accepted

Solution code:
s=input();w=int(input());ans=[]
while len(s)>0:
  ans.append(s[:w][0])
  s=s[w:]
print("".join(ans))

Submission status: Accepted

Solution code:
s = input()
w = int(input())
a = []
i = 0
while i <= len(s)-1:
    a.append(s[i])
    i += w
print("".join(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().strip()
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(len(s)):
  if i % w == 0:
    ans += s[i]
print(ans)

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = [s[i] for i in range(len(s)) if i % w == 0]
print(''.join(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:
x = input()
k = int(input())
print(x[::k])

Submission status: Accepted

Solution code:
s = input()
w = int(input())
ans = ''
for i, x in enumerate(s):
  if i%w == 0:
    ans += x
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
w=int(input())
n=(n+w-1)//w
l,r=0,w
a=[]
for i in range(n):
  t=""
  if i==n-1:
    t=s[l:]
    a.append(t[0])
    continue
  t=s[l:r]
  a.append(t[0])
  l=r
  r+=w
print("".join(a))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    s=input()
    a = int(input())
    ans =""
    for i in range(len(s)):
        if (i+1) % a ==1:
            ans+=s[i]
    if a == 1:
        print(s)
    else:
        print(ans)

Submission status: Accepted

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)]

ans = "".join(s[0] for s in sp)

print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)

s=input().rstrip()
w=int(input().rstrip())
a=""
for i in range(0,len(s),w):
    a+=s[i]
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import *

S = input()[:-1]
w = int(input())
ans = ''

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

print(ans)

Submission status: Accepted

Solution code:
S = list(input())
w = int(input())
N = len(S)
out = []
for i in range(N):
    if i%w==0:
        out.append(S[i])
print("".join(out))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
w=int(input())
ans=[]
count=0

for i in range(len(S)):
    ans+=S[count]
    count+=w
    if count>=len(S):
        break
    
ansans=''.join(ans)
print(ansans)

Submission status: Accepted

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[::w])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *
 
S = input()
w = INT()
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=""
if len(s)%w==0:
    x=len(s)//w
else:
    x=len(s)//w +1
for i in range(x):
    ans+=s[i*w]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
S = input()
w = I()
ans = []
for i in range(0,len(S),w):
    ans.append(S[i])
print(*ans,sep="")

Submission status: Accepted

Solution code:
s = input()
w = int(input())
a = ''
if len(s)%w == 0:
  b = len(s)//w
else:
  b = len(s)//w+1

for i in range(b):
  a += s[i*w]
print(a)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    s = input()
    w = int(input())

    res = [s[i] for i in range(0, len(s), w)]
    print("".join(res))


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    S = input()
    N = len(S)
    w = int(input())
    ans = []
    for i in range(0, N, w):
        ans.append(S[i])

    print(*ans, sep="")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin
S = stdin.readline().rstrip()
w = int(stdin.readline().rstrip())
print(S[::w])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
B=list(input())
A=int(input())
l=""
import math
for i in range(math.ceil(len(B)/A)):
   l+=B[i*A]
print(l)

Submission status: Accepted

Solution code:
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007

def solve():
    S = (input().rstrip())
    K = int(input().rstrip())
    for x in range(len(S)):
        if(x%K == 0):
            print(S[x],end="")


    print("")
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    w=int(input())
    ss=""
    for i in range(-(-len(s)//w)):
        ss+=s[w*i]
    print(ss)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
s = input() #sys.stdin.readlineは最後が改行
w = int(input())

ans = []
for i in range(len(s)):
    if i%w==0:
        ans.append(s[i])

print(*ans,sep='')

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:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
w=int(input())
ans=s[0]
for i in range(1,len(s)):
    if i%w==0:
        ans=ans+s[i]
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())
ans = ""
for i in range(0,len(s), w):
  ans += s[i]
print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()
    w = int(input())

    ans = S[0::w]
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    w=int(input())
    l=[]
    for i in range(-(-len(s) // w)):
        l.append(s[w*i])
    print(''.join(l))
resolve()

Submission status: Accepted

Solution code:
S=str(input())
w=int(input())
print(''.join([S[i*w] for i in range(-(-len(S)//w))]))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    S=str(input())
    w=int(input())
    ls=len(S)
    L=[S[i*w] for i in range(-(-ls//w))]
    print(''.join(L))


    
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    answer = ""

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

    print(answer)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = readline().rstrip().decode()
w = int(readline())
print(s[::w])

Submission status: Accepted

Solution code:
s= list(input())
w= int(input())
k=0
t=[]
while k*w<= int(len(s))-1:
  t.append(s[k*w])
  k+=1
  
u=''.join(t)
print(u)

Submission status: Accepted

Solution code:
S = input()
w = int(input())
N = len(S)
for i in range(0, N, w):
  print(S[i], 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:
L = list(input())
w = int(input())
i = 0
while i<len(L):
  print(L[i],end="")
  i+=w

Submission status: Accepted

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

print(S[::w])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

s = ns()
w = ni()

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

print()

Submission status: Accepted

Solution code:
print("".join([s for s in input()[::int(input())]]))

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    s = input().rstrip()
    n = int(input())
    res = ''
    for i in range(0, len(s), n):
        res += s[i]
    print(res)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
S = input()
w = int(input())
v = [S[i: i+w] for i in range(0, len(S), w)]
result = ""
for text in v:
    text = list(text)
    result += text[0]
print(result)

Submission status: Accepted

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

count = math.ceil(len(S) / w)

ans = ''
for i in range(count):
    ans += S[i*w]

print(ans)

Submission status: Accepted

Solution code:
import math

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

t = math.ceil(len(S) / w)
ans = ""
for i in range(t):
    ans = ans + S[i*w]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(str(input()))
w=int(input())
t=''
for i in range(len(s)):
  if i%w==0:
    t+=s[i]
print(t)

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:
from sys import stdin

s = stdin.readline().rstrip()
w = int(stdin.readline().rstrip())

print(s[::w])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=int(input())
print("".join([l for l in s[::n]]))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    s = S()
    w = II()
    print(s[::w])
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
# B
S = input()
w = int(input())
ans = S[0]
cnt = 1
for i in range(1, len(S)):
    if cnt == w:
        ans += S[i]
        cnt = 0
    cnt += 1
print(ans)

Submission status: Accepted

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

ans = s[::w]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

len_ = 0
if len(s) % w == 0:
    len_ = len(s)//w
else:
    len_ = len(s) // w + 1
for i in range(len_):
    print(s[w*i], end="")
print()

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(*(list(input())[::int(input())]),sep='')

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:

s = input()
w = int(input())
c = ""

for i in range(len(s)):
    if i % w == 0:
        c += s[i]
print(c)

Submission status: Accepted

Solution code:
def main():
    S = input()
    w = int(input())
    for i in range(0, len(S), w):
        print(S[i], end="")
    print()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = list(input())
b = int(input())
print("".join(a[::b]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B
import math
S = str(input())
w = int(input())
L = len(S)
ans = ""
for i in range(math.ceil(L/w) ):
    ans+=S[w*i]
    
print(ans)

Submission status: Accepted

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

for i in range(0,len(S),w):
  o.append(S[i])
  
print(''.join(o))

Submission status: Accepted

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

ans = []

for i in range(0,len(S),w):
    ans.append(S[i])


pg = ''.join(ans) 

print(pg)

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:
a = input()
b = [str(c) for c in a]
c=int(input())
d=len(b)
x=[]
for i in range(0,d,c):
	x.append(b[i])
print("".join(x))

Submission status: Accepted

Solution code:
S = str(input())
w = int(input())
N = len(S)
roop = int((N-1)/w+1)
ans = []
for i in range (roop):
  ans.append(S[i*w])
Ans =''.join(ans)
print(Ans)

Submission status: Accepted

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

for i, si in enumerate(S):
    if i % w == 0:
        print(si, end='')

Submission status: Accepted

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

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:
from math import ceil
S=input()
w=int(input())
s=""
for i in range(len(S)):
    if i%w==0:
        s="".join((s,S[i]))
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

print(s[::w])

Submission status: Accepted

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

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)