GNY07A - Mispelling

no tags 

Misspelling is an art form that students seem to excel at. Write a program that removes the nth character from an input string.

Input

The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of datasets that follow.

Each dataset consists of a single line of input containing M, a space, and a single word made up of uppercase letters only. M will be less than or equal to the length of the word. The length of the word is guaranteed to be less than or equal to 80.

Output

For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, and the misspelled word. The misspelled word is the input word with the indicated character deleted.

Example

Input:
4
4 MISSPELL
1 PROGRAMMING
7 CONTEST
3 BALLOON

Output:
1 MISPELL
2 ROGRAMMING
3 CONTES
4 BALOON

hide comments
thevillager: 2016-05-31 19:37:46

AC. Very Simple. :-) . use string datatype. and functions for flawless performance.

fralves2015: 2016-04-14 15:50:38

How can I input vars like this: "Each dataset consists of a single line of input containing M, a space, and a single word". I am using php, but this space is killing me. My actual way: "fscanf($stdin,"%d%s", $m, $word);"

farhan764: 2016-03-04 08:20:53

if u r using string in cpp then it will not give u ac.....so move on char

Ravi Chandra: 2015-08-23 08:06:02

Easy Short Simple Code

karthik1997: 2015-07-13 04:40:08

DEAD EASY :P
green in 1 go 0.0s
output format : case<space>string

Parth: 2015-06-16 22:23:45

green in 1 go.............so easy..:)

Krishna Chouhan: 2015-05-31 15:22:53

i solved this question but its not shown on my account page under "solved problems".
anybody?

lucky: 2014-11-09 19:26:54

too easy...
got AC in one go

kkkkkk: 2014-07-26 09:37:05

It will work if size is 81,1 more than 80 because 1 space is reserved for null.

Shanks: 2014-05-25 18:44:00

easy and the code is short aswell :D


Added by:Marco Gallotta
Date:2008-03-11
Time limit:19.98s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS-RHINO NODEJS PERL6 VB.NET
Resource:ACM Greater New York Regionals 2007