8965: Binary Number

内存限制:64 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:15 通过:10

题目描述

Markyyz is learning binary numbers. There is an easy problem in his homework.

You are given a binary number �1∼�s1n (�1s1 is the highest bit. ��sn is the lowest bit.). You need to do an operation exactly k times: select an interval [�,�][l,r] (1≤�≤�≤�)(1lrn) arbitrarily and flip ��,��+1,...,��sl,sl+1,...,sr, in other word, for all �∈[�,�]i[l,r]��si becomes 11 if ��si is 00��si becomes 00 if ��si is 11. What is the biggest result binary number after the k operations.

Markyyz found useless algorithms useless on the problem, so he asked SPY for help. SPY looked down on the problem but finally got WA (wrong answer). Can you help them to find the right solution?

输入格式

The first line of the input contains a single integer T (1≤�≤6×104)(1T6×104), indicating the number of test cases.

In each test case:

The first line contains two integers �,�n,k(1≤�≤105,0≤�≤1018)(1n105,0k1018)

The second line contains a binary number �1∼�s1n(�1=1(s1=1∀�∈[2,�]:��∈0,1)i[2,n]:si0,1)

It's guarenteed that in all test cases, ∑�≤2.5×106n2.5×106

输出格式

You need to print a string of length n in one line, representing the biggest binary number after the k operations.

输入样例 复制

2
8 2
10100101
5 233333333333333333
11101

输出样例 复制

11111101
11111

分类标签