Scroll
InterviewTime limit2sMemory limit1024 MB
Given a string T and an index K, swap the case of every character from position K onward to recover the original string S.
- Level
Easy2 of 10
- Topics
- String, Implementation, Simulation
- Solved
- No attempts yet
Problem
Aoi, a student at JOI High School, found a scroll in the library. The scroll has a string S of length N written on it, and each character of S is one of j, o, i, J, O, I.
Since the scroll may not be taken out of the library, Aoi decided to copy the entire string S. The string Aoi wrote down is T.
However, Aoi made a mistake: from the K-th character onward (1 ≦ K ≦ N, including the K-th character), the uppercase and lowercase of each character were swapped. That is, for 1 ≦ i ≦ K-1, the i-th character of S equals the i-th character of T; for K ≦ i ≦ N, if the i-th character of S is uppercase then the i-th character of T is lowercase, and if the i-th character of S is lowercase then the i-th character of T is uppercase.
Given the string T, its length N, and the value K, write a program that recovers the string S that was written on the scroll.
Input
The input is given from standard input in the following format.
N K
T
Output
Output the string S that was written on the scroll to standard output in one line.
Constraints
1 ≦ K ≦ N ≦ 100.Tis a string of lengthN.- Each character of
Tis one ofj,o,i,J,O,I. N, Kare integers.