/*
	[NWERC'10] WORMLY
	by: Jan Kuipers
*/

#include <iostream>
#include <string>

using namespace std;

int main () {

	int runs;
	cin >> runs;

	while (runs--) {

		int bubbles,legs,bridge;
		string plank;
		cin >> legs >> bubbles >> bridge >> plank;
		
		long long res=0;
		int leftleg=0, rightleg=legs-1, rightbubble=bubbles-1;

		while (rightleg<bridge-1) {
			int newrightleg=rightbubble;
			while (newrightleg>rightleg && plank[newrightleg]=='0') newrightleg--;
			if (newrightleg==rightleg) { res=-1; break; }

			int further=0;
			for (int i=rightleg; i<newrightleg; i++)
				if (plank[i]=='1') further++;

			while (further--) {
				leftleg++;
				while (plank[leftleg]=='0') leftleg++;
			}

			rightleg = newrightleg;
			int newrightbubble = min(bridge-1, leftleg+bubbles-1);
			res += legs + newrightbubble - rightbubble;
			rightbubble = newrightbubble;
		}

		if (res==-1)
			cout << "IMPOSSIBLE" << endl;
		else
			cout << res << endl;
	}

	return 0;
}
