TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
Kkk = int(input())  
String = str(input())
if len(String)==Kkk :
  print(String) 
else : 
  String.translate({ord(i): None for i in range(Kkk+1,len(String)-1)})
  print(String.append("..."))
    

Kkk = int(input())  
String = str(input())
res=""
if len(String)>Kkk :
   for i in range (0,len(String)):
    if i<=Kkk-1:
      res=res+String[i]
   print(res+("..."))
else : 
  print(String)
    


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()
if(len(S)>K):
    for i in range(K):
        print(S[i],end="")
    print("…")
else:
    print(S)

K = int(input())
S = input()
if(len(S)>K):
    for i in range(K):
        print(S[i],end="")
    print(". . .")
else:
    print(S)


K=int(input())
S=input()
if K>=len(S):
    print(S)
else:
    print(S[0:K]+"...")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print(s[:k] _ '...')

k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print(s[:k] + '...')

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()
ls = list(S)
if len(S) >= K:
  ansl = ls[0:K-1]
print(''.join(ansl) + '...')

K = int(input())
S = input()
ls = list(S)
if len(S) > K:
  ansl = ls[0:K]
  print(''.join(ansl) + '...')
else:
  print(S)

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()

ls = len(S)
if ls <= K:
  print(S)
else:
  print(S[:K])

K = int(input())
S = input()

ls = len(S)
if ls <= K:
  print(S)
else:
  print(S[:K]+"...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S))
  	if i <= K:
      print(S[i],end="")
    else:
      print("...")
      break

K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S)):
    if i < K:
      print(S[i],end="")
    else:
      print("...")
      break

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
if len(s) <= k:
    print(s)
else:
    print(s[: k-1] + "...")

k = int(input())
s = input()
if len(s) <= k:
    print(s)
else:
    print(s[: k] + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

k = int(input())
s = input()

t = ""
a = len(s)


if k >= a:
    print(s)
else:
    for i in range(k, len(s)):
        t += "."

    print(s[:k] + t)


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

k = int(input())
s = input()

t = ""
a = len(s)


if k >= a:
    print(s)
else:
    print(s[:k] + "...")


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
import math
list1=(input()).split()
A=int(list1[0])
B=int(list1[1])
H=int(list1[2])
M=int(list1[3])
p=math.pi
HM=(A**2+B**2-2*A*B*(math.cos(abs(p*H/6-p*M/30))))**0.5
print(HM)

K=int(input())
S=input()
list1=[]
if len(S)<=K:
  print(S)
else:
  for i in range(K):
    list1.append(S[i])
  list1.append("...")
  S2="".join(list1)
  print(S2)

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
input = input()
last_char = input[-1]
if last_char == "3":
    print("bon")
elif last_char in ["0", "1", "6", "8"]:
    print("pon")
else:
    print("hon")

max_length = int(input())
input_string = input()
if len(input_string) <= max_length:
    print(input_string)
else:
    print(input_string[:max_length] + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()

n = len(s)
if n > K:
  print(S)
else:
  print(S[0:K+1]+'...')

K = int(input())
S = input()

n = len(S)
if n <= K:
    print(S)
else:
    print(S[0:K+1] + '...')


K = int(input())
S = input()

n = len(S)
if n <= K:
    print(S)
else:
    print(S[0:K] + '...')


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = str(input())

if len(S) <= K:
  print(S)
else:
  print(S[K:]+"...")

K = int(input())
S = str(input())

if len(S) <= K:
  print(S)
else:
  print(S[:K]+"...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = str(input())

if len(S) <=K:
    print(S)
else:
    print(S[:K])

K = int(input())
S = str(input())

if len(S) <=K:
    print(S)
else:
    print(S[:K] + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
    K = int(input())
    S = input()
    print(S[:K]+'...')

K = int(input())
S = input()
if len(S) > K:
  print(S[:K]+'...')
else:
  print(S)
        

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = input()
K = int(K)
S = input()


if len(S) <= K:
  print(S)
else:
  print(S[:K], '...')


K = input()
K = int(K)
S = input()


if len(S) > K:
  print(S)
else:
  print(S[:K], '...')


K = map(int, input())
S = input()


if len(S) > K:
  print(S)
else:
  print(S[:K], '...')

K = input()
K = int(K)
S = input()


if len(S) <= K:
    print(S)
else:
    print(f'{S[:K]}...')

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k=int(input())
s=input()
l=len(s)
if l<=k:
    print(s)
else:
    n=s[0:k]
    print(n)

k=int(input())
s=input()
l=len(s)
if l<=k:
    print(s)
else:
    n=s[0:k]
    print(n+'...')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input(str())

if K >= len(S):
    print(S)
else:
    print(S[:0 + K], "...")

K = int(input())
S = input(str())

if K >= len(S):
    print(S)
else:
    print(S[:+ K], ("..."), sep='')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())

S = input()
s = len(S)

if s <= K:
  print(S)
else:
  print(S[:K+1]+'...')

K = int(input())

S = input()
s = len(S)

if s <= K:
  print(S)
else:
  print(S[:K]+'...')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K=int(input())
S=input()
if len(S)<=K:print(S)
else:print(S[0:K-1]+'...')

K=int(input())
S=input()
if len(S)<=K:print(S)
else:print(S[0:K]+'...')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = str(input())
if len(S) <= K:
    print(S[:K])
elif len(S) > K:
    print(S[:K] + ("." * (len(S) - K)))


K = int(input())
S = str(input())
if len(S) <= K:
    print(S[:K])
elif len(S) > K:
    print(S[:K] + ("." * 3))


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = input()
S = input()

K = int(K)

if (len(S) <= K):
    print(S)

elif (len(S) > K):
    M = S[K:]
    print(M + "...")

K = input()
S = input()

K = int(K)

if (len(S) <= K):
    print(S)

elif (len(S) > K):
    M = S[:K]
    print(M + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
if(len(s) > k):
  print(s[:k+1] + '...')
else:
  print(s)

k = int(input())
s = input()
if(len(s) > k):
  print(s[:k] + '...')
else:
  print(s)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):







N, M = map(int, input().split())
study_days = map(int, input().split())


# study_days_list = []
# study_days_list.append(study_days)
# print(study_days_list)

total_study_days = sum(study_days)

answer = (N - total_study_days)

if answer < 0:
    print(-1)
else:
    print(answer)

K = int(input())
S = str(input())

SK = S[0 : (K)]

if len(S) <= K:
    print(S)
else:
    print(SK + '...')

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):

K = int(input())
S = input()

if len(S) <= K-1:
  print(S)
else:
  print(S[0:K-1],"...")

K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  print(S[0:K-1],"...")

S = map(str, input())
K = input()

if len(S) <= K:
  print(S)
else:
  print(S[0:K],"...")

S = str(input())
K = int(input())

if len(S) <= K:
  print(S)
else:
  print(S[0:K],"...")

S = input()
K = int(input())

if len(S) <= K:
  print(S)
else:
  print(S[0:K],"...")

K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  print(S[0:K]+"...")

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
S = len(s)
if S >= k or S == k:
    print(s[:k],"...")
else:
    print(s)

k = int(input())
s = input()
S = len(s)
if S <= k:
    print(s)
else:
    print(s[:k],"...")

k = int(input())
s = input()
S = len(s)
if S < k:
    print(s)
else:
    print(s[:k],"...")


k = int(input())
s = str(input())
S = len(s)
if S <= k:
    print(s)
else:
    print(s[:k],"...")


k = int(input())
s = input()
S = len(s)
if S > k :
    print(s[:k],"...")
else:
    print(s)

k = int(input())
s = input()
if len(s) > k:
    print(s[:k]+'...')
else:
    print(s)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = str(input())
print(s[:k])


k = int(input())
s = str(input())
if k < len(s):
    print(s[:k] + "...")
else:
    print(s[:k])

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
str = list(input())

if len(str) <= K:
  print("".join(str))
else:
  print("".join(str[0:K]))

K = int(input())
str = list(input())
 
if len(str) <= K:
  print("".join(str))
else:
  print("".join(str[0:K]) + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + "...")

K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + "...")

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k=int(input())
s=input()
n=len(s)
if k>=n:
  print(s)
else:
  ans =""
  for i in range(k):
    ans+=s[i]
  s+="..."
  print(s)


k=int(input())
s=input()
n=len(s)
if k>=n:
  print(s)
else:
  ans =""
  for i in range(k):
    ans+=s[i]
  ans+="..."
  print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
lists = list(s)
news = list()
if len(lists) <= k:
    print(s)
else:
    for i in range(k):
        news.append(lists[i])
print("".join(news))

k = int(input())
s = input()
lists = list(s)
news = list()
if len(lists) <= k:
    print(s)
else:
    for i in range(k):
        news.append(lists[i])
    result = "".join(news)
    print(result + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[K-1:-1]

K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[:K+1]+'...')


K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[:K]+'...')


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
if len(s) < k:
    print(s)
else:
    print(s[:k+1]+'...')

k = int(input())
s = input()
if len(s) <= k:
    print(s)
else:
    print(s[:k]+'...')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
# -*- coding: utf-8 -*-


S=input()
K=input()


if(len(K)>=S):
    print(K[0:S]+"...")

else:
    print(K)


# -*- coding: utf-8 -*-


S=int(input())
K=input()


if(len(K)>S):
    print(K[0:S]+"...")

else:
    print(K)


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
import sys
import math
input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()

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

def solve(s,k):
    len1 = len(s)
    if len1 > k:
        corte = ''
        for i in range(k):
            corte += s[i]
        corte += '...'
        return corte
	else :
      return s
def main():
    k = inp()
    print(solve(input(),k))


main()




K = int(input())
S = input()

if len(S) > K:

    for i in range(0,K):

        print(S[i], end="")

    print("...")

else:

    print(S)


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[:K],'...')

K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(S[:K], "...")

K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    str = S[:K]+'...'
    print(str)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  s[0:k] + "..."

k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print(s[0:k] + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = str(input())
sen = ''
if len(S)<=K:
  print(S)
else:
 # print(S[0:K-1])
  sen = S[0:K-1] + '...'
  print(sen)

K = int(input())
S = str(input())
sen = ''
if len(S)<=K:
  print(S)
else:
 # print(S[0:K-1])
  sen = S[0:K] + '...'
  print(sen)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(inpout())
s = input()

if len(s) < k :
  print(s)
else:
  print(substr(s,0,k)+"...")

k = int(input())
s = input()
 
if len(s) < k :
  print(s)
else:
  print(substr(s,0,k)+"...")

k = int(input())
s = input()
 
if len(s) <= k :
  print(s)
else:
  print(s[0:k]+"...")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()

K = min(len(S), K)
for i in range(K):
    print(S[i], end='')

print('...' if K > len(S) else '')

K = int(input())
S = input()

K = min(len(S), K)
for i in range(K):
    print(S[i], end='')

print('...' if K < len(S) else '')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
length=eval(input(""))
string = input("")

if(len(string)==length):
    print(string)
if(len(string)>length):
    print(string[0:length],end="...")

number=int(input())
word=input()
length=len(word)
if length<=number:
  print(word)
if length>number:
  word=word[0:number]
  print(word+"...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
N = int(input())
s = int(str(N)[-1])

if s in (2, 4, 5, 7, 9):
    print("hon")
elif s in (0, 1, 6, 8):
    print("pon")
else:
    print("bon")


K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[:K]+"...")


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K=int(input())
S=input()

if len(S)<=K:
  print(S)
else:
  print(S[K:]+"...")

K=int(input())
S=input()
 
if len(S)<=K:
  print(S)
else:
  print(S[:K]+"...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
print((s[:k], s)[k >= len(s)])

k = int(input())
s = input()
print(('{}...'.format(s[:k]), s)[k >= len(s)])

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K, S = input().split()
K = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + "...")

K, S = map(str, input().split())
K = int(K)

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

K, S = input().split()
K = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + '...')

K, S = map(str, input().split())
K = int(K)

if len(S) <= K:
    print(S)
else:
    S = (S[0:K]+"..."
    print(S)

k, s = input().split()
k = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + "...")

k, s = input().split()
k = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[1:k] + "...")

K, S = map(str, input().split())
K = int(K)

if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")

k, s = input().split()
k = int(k)

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + "...")


K, S = input().split()
K = int(K)

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + '...')

K, S = map(str, input().split())
K = int(K)

print(len(S))
print(K)

print(len(S) >= K)
if len(S) <= K:
    print(S)
else:
    print(S[0:K]+"...")

K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    S = S[0:K]+"..."
    print(S)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = int(input())
if K > len(S):
    print(S)
else:
    print(S[0:K] + '...')

K = int(input())
S = input()
if K >= len(S):
    print(S)
else:
    print(S[0:K] + '...')

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
keta = int(input())
word = str(input())

if len(word) <= keta:
  print(word)
else:
  print(word[:keta-1] + "...")

keta = int(input())
word = str(input())
 
if len(word) <= keta:
  print(word)
else:
  print(word[:keta] + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()

print(S[:K])

K = int(input())
S = input()

if len(S)<=K:
  print(S[:K])
else:
  print(S[:K] + '...')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
n=int(input())
s=input()
if len(s)<=n:
  print(s)
else:
  print(s[:n,'...',sep=''])

n=int(input())
s=input()
if len(s)<=n:
  print(s)
else:
  print(s[:n],'...',sep='')

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
s = int(input())
t = input() 

if len(t) <= s:
  print(t)
else:
  print(t[:s],"...")

s = int(input())
t = input() 

if len(t) <= s:
  print(t)
else:
  ans = t[:s] + "..."
  print(ans)
  

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
nb = int(input())
sentence = input()

if len(sentence) > nb:
	print(sentence[0:nb-1] + '...')
else:
	print(sentence)

nb = int(input())
sentence = input()

if len(sentence) > nb:
	print(sentence[0:nb] + '...')
else:
	print(sentence)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):

n=int(input())
st=input()
if n>=len(st):
    print(st)
else:
    print(st[0:n-1])


n=int(input())
st=input()
if n>=len(st):
    print(st)
else:
    print(st[0:n-1]+"...")

n=int(input())
st=input()
if n>=len(st):
    print(st)
else:
    print(st[0:n]+"...")
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input()) 
S = input()

if len(S) > K:
    S = S[:K]  + '...'

print(a)

K = int(input()) 
S = input()

if len(S) > K:
    S = S[:K]  + '...'

print(S)

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
len_s = len(s)
 
if len_s <= k:
  print(s)
else:
  print(''.join([str(x) for x in [s[:k], '...']])

k = input()
s = int(input())
len_s = len(s)
 
if len_s <= k:
  print(s)
else:
  print(''.join([str(x) for x in [s[:k], '...']])

k = input()
s = int(input())
len_s = len(s)

if len_s <= k:
  print(s)
else:
  print(''.join([str(x) for x in [s[:k+1], '...']])
  

k = int(input())
s = str(input())
len_s = len(s)
 
if len_s <= k:
  print(s)
else:
  print(''.join([str(x) for x in [s[:k+1], '...']])

k = int(input())
s = input()
len_s = len(s)
 
if len_s <= k:
  print(s)
else:
  print(''.join([str(x) for x in [s[:k+1], '...']])

k = int(input())
s = str(input())
len_s = len(s)
 
if len_s <= k:
  print(s)
else:
  print(s[:k] + '...')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = input()
s = input()
print(s)
if(len(s) <= int(k)):
  print(s)
else:
  print(s[:int(k)])

k = input()
s = input()
if(len(s) <= int(k)):
  print(s)
else:
  print(s[:int(k)])

k = input()
s = input()
print(s)
if(len(s) <= int(k)):
  print(s)
else:
  print(s[:int(k)]+'...')

k = input()
s = input()
if(len(s)<=k):
  print(s)
else:
  print(s[:k])

k = input()
s = input()
if(len(s) <= int(k)):
  print(s)
else:
  print(s[:int(k)]+'...')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
#!/usr/bin/env python3
import sys


def solve(K: int, S: str):
    if (len(S) <= K):
        print(S)
    else:
        print(K[0:K+1], "...", sep='')
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(K, S)

if __name__ == '__main__':
    main()


#!/usr/bin/env python3

import sys

def solve(K: int, S: str):
    if (len(S) <= K):
        print(S)
    else:
        print(S[0:K], "...", sep='')
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(K, S)

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
    s = str(input())
    if len(s) <= k:
        print(s)
    else:
        print(s[:k])

k = int(input())
    s = input()
    if len(s) <= k:
        print(s)
    else:
        print(s[:k]+'...')

 k = int(input())
    s = str(input())
    if len(s) <= k:
        print(str(s))
    else:
        print(s[:k])

k = int(input())
    s = str(input())
    if len(s) <= k:
        print(s)
    else:
        print(s[:k]+'...')

k = int(input())
s = input()
if k >= len(s):
  print(s)
else:
  print(s[:k]+"...")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = str(input())

if len(S)>K:
  print(S[0:K], "...")
else:
  print(S)

K = int(input())
S = str(input())

if len(S)>K:
  print(S[0:K] + "...")
else:
  print(S)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
T=int(input())
S=str(input())
s=len(S)
if s<T:
    print(S)
else:
    print(S+'...')

T=int(input())
S=str(input())
s=len(S)
if s<=T:
    print(S)
else:
    print(S[:T]+'...')

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()
SS = (int(len(S)))
if SS-K < 0:
  print(S)
else:
  print((S[:SS-K])+('.'*K))

K = int(input())
S = input()
SS = (int(len(S)))
if SS-K <= 0:
  print(S)
else:
  print((S[:K-SS])+('.'*(SS-K)))

K = int(input())
S = input()
SS = (int(len(S)))
if SS-K <= 0:
  print(S)
elif K == 0:
  print(S)
else:
  print((S[:K-SS])+('.'*(SS-K)))

K = int(input())
S = input()
SS = (int(len(S)))
if S <= 0:
  print(s)
else:
print(S[:SS-K])+print('.',K)

K = int(input())
S = input()
SS = (int(len(S)))
if SS-K <= 0:
  print(S)
else:
  print((S[:SS-K])+('.'*K))

K = int(input())
S = input()
SS = (int(len(S)))
if SS-K <= 0:
  print(S)
else:
  print((S[:K-SS])+('.'*3))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
class Strs:
    def __init__(self, k, s):
        self.k = k
        self.s = s

    def triple_dods(self):
        if self.k >= len(self.s):
            print(self.s)
        elif self.k <= len(self.s):
            print(self.s[0: self.k] + "...")

k = int(input())
s = input()
strs = Strs(k, s)
print(strs)

strs.triple_dods()

k = int(input())
s = input()

if k >= len(s):
    print(s)
elif k <= len(s):
    print(s[0: k] + "...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = input()
S = int(input())

if len(S) <= K:
  print(S)
else:
  print(S[:K] + '...')



K = int(input())
S = input()
 
if len(S) <= K:
  print(S)
else:
  print(S[:K] + '...')

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
from math import cos, sqrt, pi
a, b, h, m = map(int, input().split())

ang_a = pi * h / 6 + pi * m / 360

ang_b = pi * m / 30

ang = abs(ang_a-ang_b)

c = sqrt(a**2 + b**2 - 2*a*b*cos(ang))
print(c)

k = int(input())
s = str(input())
if k < len(s):
    ans = s[0:k+1]+'...'
    print(ans)
else:
    print(s)

k = int(input())
s = str(input())
if k < len(s):
    ans = s[0:k]+'...'
    print(ans)
else:
    print(s)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()
length = len(s)
if k < length:
    s = s[:k]
    for i in range(k, length):
        s += '.'

print(s)

k = int(input())
s = input()
length = len(s)
if k < length:
    s = s[:k]
    s += '...'

print(s)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = input()
S = input()
if len(K) >= len(S):
  print(S)
else:
  strings = S[:K + 1] + '...'
  print(strings)

K = input()
S = input()
strings = ''
if len(K) >= len(S):
  print(S)
else:
  strings = str(S[:K]) + '...'
  print(strings)


K = input()
S = input()
strings = ''
if len(K) >= len(S):
  print(S)
else:
  strings = str(S[:K + 1]) + '...'
  print(strings)


N = str(input())
identify = N[-1]
answer = 'hon'
pon_list = ['0','1', '6', '8']
bon_list = ['3']
if identify in pon_list:
  answer = 'pon'
elif identify in bon_list:
  answer = 'bon'
print(answer)

K = input()
S = input()
if len(K) >= len(S):
  print(S)
else:
  strings = str(S[:K]) + '...'
  print(strings)

K = input()
S = input()
if len(K) > len(S):
  print(S)
else:
  strings = S[:K + 1]
  print(strings)

K = int(input())
S = input()
strings = ''
if K >= len(S):
  print(S)
else:
  strings = str(S[:K]) + '...'
  print(strings)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K=int(input())
S=input()
A=len(S)
if A=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')
  
  


K=int(input())
S=input()
A=len(S)
if A<=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')
  
  


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = int(input())
s = input()

print(s if(k>=len(s)) else s[:k],"...")

k = int(input())
s = input()

if(len(s) <= k):
	print(s)
else:
	print(s[:k]+"...")

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()

if len(S) =< len(K):
    print(S)
    
else:
    print((str[1:S])+'...')

K = int(input())
S = input()
 
if len(S) =< len(K):
    print(S)
    
else:
    print(S[1:len(S)]+'...')

K = int(input())
S = input()
 
if len(S) <= K:
    print(S)
    
else:
    print(S[0:K]+'...')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()
a = ""
if len(S)<=K:
    print(S)
else:
    for i in range(K):
        a+=S[i]
    print(a,"...")

K = int(input())
S = input()
a = ""
if len(S)<=K:
    print(S)
    exit()
else:
    for i in range(K):
        a+=S[i]
print(a,"...")

K = int(input())
S = input()
a = ""
if len(S)<=K:
    print(S)
    exit()
else:
    for i in range(K):
        a+=S[i]
print(a,"...")


K = int(input())
S = input()
a = ""
if len(S)<=K:
    exit(S)
else:
    for i in range(K):
        a+=S[i]
print(a,"...")

K = int(input())
S = input()
if len(S)<=K:
    print(S)
else:
    print(S[:K]+"...")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
n = int(input())
s = input()
a = len(s)
if s <= n:
  print(s)
else:
  print(s[0:n-1] + '...')


n = int(input())
s = input()
a = len(s)
if a <= n:
  print(s)
else:
  print(s[0:n-1] + '...')


n = int(input())
s = input()
a = len(s)
if a >= n:
  print(s)
else:
  print(s[0:n-1] + '...')


n = int(input())
s = input()
a = len(s)
if a <= n:
  print(s)
else:
  print(s[0:n] + '...')


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
#input an interget
K=int(input())
#input an string
S=str(input())
#get the length of the string
x=int(len(str1))
#get the difference in length between k and s
i=x-k

#make a second string for the appending
S2="..."

#if statement about how the string will function
#if the string is the same length as k then print it
if i==0:
    print(S)
#if not, delete the last character of the string
else:
    while i>0:
        S=S[i]
        i+=1
#and then join the two strings together
    newstr="".join((S,S2))
    print(newstr)


#K is an input for the range of S
#input from user to get lowercase the letters
K = int(input())
S = input()
if len(S) > K:
    print(S[:K] + ".....")
else:
    print(S)


while True:
     k = input()
     if 1 <= int(k) <= 100:
         break;
     print ('Error Invalid Input for K')


while True:
     s = input().lower()
     if 1 <= len(s) <= 100:
         break;
     print ('Error Invalid Input for s')


if len(s) > k:
    print(s[:k] + "...")
else:
    print(s)

def tripleDots(n, string):
	string_len = len(string)
	if string_len > n : 
		string = string[ 0 : n ] + "..."
	return string

arr = ["", ""]

for i in range(2):
	arr[i] = input()


tripleDots(int(arr[0]), arr[1])

k=int(input())
s=input()
characters=len(s)
empty=""
if characters<=k:
    print(s)
else:
   i=0
   while i<=k-1:
       empty+=s[i]
       i=i+1
   print(f"{empty}...")

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
k = input()
s = input()
i = 0

while i < 7:
	print(s[i])
    i = i + 1

k = input()
s = input()
i = 0
list = []
l = int(k)

while i < l:
    list.append(s[i])
    i = i + 1

print(list)

k = input()
s = input()
i = 0
l = int(k)
p = None

while i < l:
    p = p + s[i]
    i = i + 1

print(p)

k = input()
s = input()
i = 0

while i < int(k):
	print(s[i])
    i = i + 1

k = input()
s = input()
i = 0
l = int(k)

while i < l:
    p = p + s[i]
    i = i + 1

print(p)

k = input()
s = input()
i = 0
l = int(k)

while i < l:
	print(s[i])
    i = i + 1

k = input()
s = input()
i = 0
l = int(k)
p = str()

while i < l:
    p = p + s[i]
    i = i + 1

print(p)

k = input()
s = input()
i = 0
l = int(k)
p = str()
 
while i < l and len(s) > l:
    p = p + s[i]
    i = i + 1
while i < len(s) and len(s) <=l:
    p = p + s[i]
    i = i + 1
if len(s) > l:
	print(p + '...')
else:
	print(p)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = input()

if K>=len(S):
    print(S)
else:
    print(S[:K+1]+"...")


K = int(input())
S = input()

if K>=len(S):
    print(S)
else:
    print(S[:K]+"...")


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K = int(input())
S = str(input())

print(len(S))

if len(S) <= K :
    print(S)
else :
    a = S[:K] + '...'
    print(a)


K = int(input())
S = str(input())


if len(S) <= K :
    print(S)
else :
    a = S[:K] + '...'
    print(a)


Verdicts: Wrong Answer

Accepted