#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const ll mod = 1e9 + 7;
inline int read(){
    int f = 1,x = 0; char ch = getchar();
    while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x * 10 + ch - 48;ch = getchar();}
    return f * x;
}
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
ll poww(ll x,ll y,ll p){ll ans = 1;while(y){if(y & 1) ans = ans * x % p;x = x * x % p;y >>= 1;}return ans;}
int q,n,k;
string s;
set<int> pos;
int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> q;
	while(q--){
		cin >> n >> k;
		cin >> s;
		pos.clear();
		for(int i = 0;i < n;i++){
			if(s[i] == '1') pos.insert(i);
		}
		for(int i = 0;i < n;i++){
			if(k <= 0) break;
			if(s[i] == '0'){
				if(i < *pos.begin()) continue;
				int p = *pos.lower_bound(i - k);
				k -= (i - p);
				pos.erase(p);
				pos.insert(i);
			}
		}
		for(int i = 0;i < n;i++){
			if(pos.find(i) != pos.end()) cout << 1;
			else cout << 0;
		}
		cout << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int q,n;
ll k;
string s;
int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> q;
	while(q--){
		cin >> n >> k >> s;
		string res;
		int cnt = 0;
		bool ok = 0;
		for(int i = 0;i < n;i++){
			if(s[i] == '0'){
				if(cnt <= k){
					res += '0';
					k -= cnt;
				} else{
					res += string(cnt - k,'1');
					res += '0';
					res += string(k,'1');
					res += s.substr(i + 1);
					cout << res << endl;
					ok = 1;
					break;
				}
			}
			else cnt++;
		}
		if(!ok){
			res += string(cnt,'1');
			cout << res << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll k;
string s;
int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> q;
	while(q--){
		cin >> n >> k >> s;
		ll st = 0;
		for(int i = 0;i < n;i++){
			if(k <= 0) break;
			if(s[i] == '0'){
				ll d = min(k,i - st);
				swap(s[i],s[i-d]);
				st++,k-=d;
			}
		}
		cout << s << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 5;

inline int read(){
    int f = 1,x = 0; char ch = getchar();
    while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x * 10 + ch - 48;ch = getchar();}
    return f * x;
}
ll poww(ll x,ll y){
    ll ans = 1;
    while(y){
        if(y & 1) ans = ans * x;
        x = x * x;
        y >>= 1;
    }
    return ans;
}
int q,n,k;
char s[maxn];
set<int> seq;
int main()
{
    cin >> q;
    while(q--){
        seq.clear();
        cin >> n >> k;
        scanf("%s",&s);
        int mi = -1;
        for(int i = 0;i < n;i++){
            if(s[i] == '0'){
                seq.insert(i);
            }
        }
        for(int i = 0;i < n;i++){
            if(s[i] == '0'){
                if(k - i >= 0){
                    int p = i;
                    k -= i;
                    seq.erase(i);
                    if(mi != i - p) seq.insert(i - p);
                    else seq.insert(mi + 1);
                    mi = mi + 1;
                }
                else{
                    int p = k;
                    seq.erase(i);
                    if(mi != i - p) seq.insert(i - p);
                    else seq.insert(mi + 1);
                    break;
                }
            }
        }
        for(int i = 0;i < n;i++){
            if(!seq.count(i)) cout << '1';
            else cout << '0';
        }
        cout << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int q,n,st;
ll k;
string s;
int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> q;
	while(q--){
		cin >> n >> k >> s;
		ll st = 0;
		for(int i = 0;i < n;i++){
			if(k <= 0) break;
			if(s[i] == '0'){
				ll d = min(k,i - st);
				swap(s[i],s[i-d]);
				st++,k-=d;
			}
		}
		cout << s << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const ll mod = 1e9 + 7;
inline int read(){
    int f = 1,x = 0; char ch = getchar();
    while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x * 10 + ch - 48;ch = getchar();}
    return f * x;
}
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
ll poww(ll x,ll y,ll p){ll ans = 1;while(y){if(y & 1) ans = ans * x % p;x = x * x % p;y >>= 1;}return ans;}
int q,n,k;
string s;
set<int> pos;
int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> q;
	while(q--){
		cin >> n >> k;
		cin >> s;
		for(int i = 0;i < n;i++){
			if(s[i] == '1') pos.insert(i);
		}
		for(int i = 0;i < n;i++){
			if(k <= 0) break;
			if(s[i] == '0'){
				int p = *pos.lower_bound(i - k);
				k -= (i - p);
				pos.erase(p);
				pos.insert(i);
			}
		}
		for(int i = 0;i < n;i++){
			if(pos.find(i) != pos.end()) cout << 1;
			else cout << 0;
		}
		cout << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
const ll mod = 1e9 + 7;
inline int read(){
    int f = 1,x = 0; char ch = getchar();
    while(ch < '0' || ch > '9'){if(ch == '-')f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x * 10 + ch - 48;ch = getchar();}
    return f * x;
}
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
ll poww(ll x,ll y,ll p){ll ans = 1;while(y){if(y & 1) ans = ans * x % p;x = x * x % p;y >>= 1;}return ans;}
int q,n,k;
string s;
set<int> pos;
int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> q;
	while(q--){
		cin >> n >> k;
		cin >> s;
		pos.clear();
		for(int i = 0;i < n;i++){
			if(s[i] == '1') pos.insert(i);
		}
		for(int i = 0;i < n;i++){
			if(k <= 0) break;
			if(s[i] == '0'){
				int p = *pos.lower_bound(i - k);
				k -= (i - p);
				pos.erase(p);
				pos.insert(i);
			}
		}
		for(int i = 0;i < n;i++){
			if(pos.find(i) != pos.end()) cout << 1;
			else cout << 0;
		}
		cout << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		// cout<<str<<"\n";
		for(int i=0;i<str.length();i++)
		{
			a[i]=str[i]-'0';
			// cout<<str[i]-'0'<<" ";
		}
        // for(int i=0;i<n;i++)cout<<a[i]<<" ";
        // cout<<"\n";
		vector<pair<int,int> >v;
		for(int i=0;i<n;i++)
		{

			v.push_back({a[i],i+1});
		}
		sort(v.begin(),v.end());
		int cnt=0;
		for(int i=0;i<v.size();i++)
		{
			if(!is_sorted(a,n) and cnt<k)
			{
				int max_shift=(k-cnt);
				int req=v[i].second-i-1;
				if(req<=max_shift)
				{
					cnt+=req;
					shift(a,i,v[i].second-1);
				}
				else{
					cnt=k;
					int j=v[i].second-max_shift-1;
					shift(a,j,v[i].second-1);
				}

			}
			else if(is_sorted(a,n) or cnt>=k)break;
		}
		display(a,n);
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
    #define int long long
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		// int a[n];

		string str;
		cin>>str;
		vector<int>v;
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            if(str[i]=='0'){
             zeros++;
             v.push_back(i);
            }

        }
        int pos=0;
        int cnt=0;
        // for(int i=0;i<n;i++)cout<<v[i]<<" ";
        // cout<<"\n";
        int a[n+1];
        for(int i=0;i<n;i++)a[i]=1;
        int kk=0;
        while(k>0 and pos<=n-1 and zeros>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=v[kk];
            // v.erase(v.begin()+min_ele_index);
            kk++;
            if(min_ele_index-pos<=k and pos<=n-1){
                // v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                a[pos]=0;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                // v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');
                a[min_ele_index-k]=0;
                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        // cout<<kk<<"\n";
        if(kk<v.size())
        {
            for(int i=kk;i<v.size();i++)a[v[i]]=0;
        }
        for(int i=0;i<n;i++)cout<<a[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
    #define int long long
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n+n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            v[i]=str[i]-'0';
            if(!v[i])zeros++;
        }
        int pos=0;
        int cnt=0;
        while(k>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(min_ele_index-pos<=k and pos<=n-1){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
    #define int long long
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n+n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            v[i]=str[i]-'0';
            if(!v[i])zeros++;
        }
        int pos=0;
        int cnt=0;
        while(k>0 and pos<=n-1)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(min_ele_index-pos<=k and pos<=n-1){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
    #define int long long
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n+n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            if(str[i]=='0'){
             zeros++;
             v[i]=0;
            }
            else v[i]=1;
        }
        int pos=0;
        int cnt=0;
        // for(int i=0;i<n;i++)cout<<v[i]<<" ";
        // cout<<"\n";
        while(k>0 and pos<=n-1 and zeros>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(min_ele_index-pos<=k and pos<=n-1){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
    #define int long long
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            v[i]=str[i]-'0';
            if(!v[i])zeros++;
        }
        int pos=0;
        int cnt=0;
        while(k>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(cnt+min_ele_index-pos<=k and pos<=n-1){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v;
        for(int i=0;i<n;i++)
        {
            if(str[i]=='0')v.push_back(i);
        }
        int i=0;
        while(k>0 and !v.empty())
        {
            if( v[i]<=k)
            {
                k-=v[i];
                if(i==0)v[i]=0;
                else v[i]=v[i-1]+1;
                i++;

            }
            else{
                v[i]-=k;
                k=0;
                break;
                i++;
            }
           // i++;
        }
        for(i=0;i<n;i++){
            a[i] = 1;
        }
        for(i=0;i<v.size();i++)a[v[i]]=0;
        for(i=0;i<n;i++)
        {
            if(a[i]==0)cout<<0;
            else cout<<1;
        }
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v;
        for(int i=0;i<n;i++)
        {
            if(str[i]=='0')v.push_back(i);
        }
        int i=0;
        while(k>0)
        {
            if(v[i]<=k)
            {
                k-=v[i];
                if(i==0)v[i]=0;
                else v[i]=v[i-1]+1;

            }
            else{
                v[i]-=k;
                k=0;
                break;
            }
            i++;
        }
        for(int i=0;i<n;i++){
            a[i] = 1;
        }
        for(int i=0;i<v.size();i++)a[v[i]]=0;
        for(int i=0;i<n;i++)
        {
            if(a[i]==0)cout<<0;
            else cout<<1;
        }
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
    #define int long long
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n+n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            v[i]=str[i]-'0';
            if(!v[i])zeros++;
        }
        int pos=0;
        int cnt=0;
        while(k>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(cnt+min_ele_index-pos<=k and pos<=n-1){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            v[i]=str[i]-'0';
            if(!v[i])zeros++;
        }
        int pos=0;
        int cnt=0;
        while(k>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(cnt+min_ele_index-pos<=k and pos<=n-1){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v;
        for(int i=0;i<n;i++)
        {
            if(str[i]=='0')v.push_back(i);
        }
        int i=0;
        while(k>0 and !v.empty())
        {
            if( v[i]<=k)
            {
                int prev=v[i];
                if(i==0)v[i]=0;
                else v[i]=v[i-1]+1;
                k-=v[i]-prev;
                i++;

            }
            else{
                v[i]-=k;
                k=0;
                break;
                i++;
            }
           // i++;
        }
        for(i=0;i<n;i++){
            a[i] = 1;
        }
        for(i=0;i<v.size();i++)a[v[i]]=0;
        for(i=0;i<n;i++)
        {
            if(a[i]==0)cout<<0;
            else cout<<1;
        }
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            v[i]=str[i]-'0';
            if(!v[i])zeros++;
        }
        int pos=0;
        int cnt=0;
        while(k>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(cnt+min_ele_index-pos<=k){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
int is_sorted(int a[],int n)
{
	for(int i=0;i<n-1;i++)
	{
		if(a[i]>a[i+1])return 0;
	}
	return 1;
}
void display(int a[],int n)
{
	for(int i=0;i<n;i++)cout<<a[i];
	cout<<"\n";
}
void shift(int a[],int l,int r)
{
	int ele=a[r];
	for(int i=r-1;i>=l;i--)
	{
		a[i+1]=a[i];
	}
	a[l]=ele;
}
int main() {
	int q;
	cin>>q;
	while(q--)
	{
		int n,k;
		cin>>n>>k;
		int a[n];

		string str;
		cin>>str;
		vector<int>v(n);
        int zeros=0;
        for(int i=0;i<n;i++)
        {
            v[i]=str[i]-'0';
            if(!v[i])zeros++;
        }
        int pos=0;
        int cnt=0;
        while(k>0)
        {
            // cout<<cnt<<"\n";
            int min_ele_index=min_element(v.begin()+pos,v.end())-v.begin();
            v.erase(v.begin()+min_ele_index);
            if(min_ele_index-pos<=k and pos<=n-1){
                v.insert(v.begin()+pos,str[min_ele_index]-'0');
                k-=min_ele_index-pos;
                pos+=1;
                cnt++;
            }
            else{
                // cout<<"**";
                v.insert(v.begin()+min_ele_index-k,str[min_ele_index]-'0');

                break;
            }
            if(cnt==zeros)break;
            // for(int i=0;i<n;i++)cout<<v[i];
            // cout<<"\n";

        }
        for(int i=0;i<n;i++)cout<<v[i];
        cout<<"\n";
	}
}


#include <bits/stdc++.h>

using namespace std;

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

	int q;
	cin >> q;
	while (q--) {
		int n;
		long long k;
		string s;
		cin >> n >> k >> s;
		string res;
		int cnt = 0;
		bool printed = false;
		for (int i = 0; i < n; ++i) {
			if (s[i] == '0') {
				if (cnt <= k) {
					res += '0';
					k -= cnt;
				} else {
					res += string(cnt - k, '1');
					res += '0';
					res += string(k, '1');
					res += s.substr(i + 1);
					cout << res << endl;
					printed = true;
					break;
				}
			} else {
				++cnt;
			}
		}

		if (!printed) {
			res += string(cnt, '1');
			cout << res << endl;
		}
	}

	return 0;
}


//rohitaas_15
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll  long long
#define int ll
#define rohitaas_15(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define f(a,b) for(int i=a;i<=b;i++)
#define f2(a,b) for(int j=a;j<=b;j++)
#define f3(a,b) for(int k=a;k<=b;k++)
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define ff first
#define ss second
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define co(x) cout<<x<<"\n"
#define pv(v,x,n) f(x,n-1){cout<<v[i]<<" ";}
#define cn(v,x,n) f(x,n){cin>>v[i];}
#define check() cout<<"hi"<<"\n"
#define MOD1 1000000007
#define MOD2 998244353
#define con continue
#define maxv(v) *max_element(all(v));
#define minv(v) *min_element(all(v));
#define sumv(v) accumulate(all(v),0)
#define test() ll t;cin>>t;while(t--)
#define pf pop_front
#define popb pop_back
#define popf pop_front
#define br break
#define rev(x)  reverse(all(x))
#define vr vector<ll>
#define vs vector<string>
#define vd vector<double>
#define vll vector<pii>
#define PI 3.141592653
#define MLL map<ll,ll>
#define yes co("YES");
#define no co("NO");
#define nl cout<<"\n"
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll lcm(ll a , ll b){return (a*b)/ gcd(a,b);}
ll power(ll x, ll y, ll p=LLONG_MAX){ll res = 1;x = x % p;while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}return res;}
double power2(double x, ll y){double res = 1;while (y > 0){if (y & 1)res =(double) (res*x);y = y>>1;x =(double)(x*x);}return res;}
ll modInverse(ll n, ll p){return power(n, p-2, p);}
ll CmP(ll n, ll r, ll p=MOD1){if (r==0)return 1;ll fac[n+1];fac[0] = 1;for (ll i=1 ; i<=n; i++)fac[i] = fac[i-1]*i%p;return (fac[n]* modInverse(fac[r], p) % p *modInverse(fac[n-r], p) % p) % p;}
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> orderedset;
/*find_by_order(ll k)
{returns the iterator to the kth largest element,start from 0,O(logn)}
order_of_key(ll k)
{returns the number of elements in the set which are strictly less than our k,O(logn)}*/
void solve(){

}
void ask(){}
signed main()
{
	 rohitaas_15();
	 int t=1;
	 cin>>t;
	 int cccc=t;
	 while(t--)
	 {
	 	ll n,k;
	 	cin>>n>>k;
	 	string s;
	 	cin>>s;
	 	vr ones,zeroes;
	 	f(0,s.length()-1)
	 	{
	 		if(s[i]=='1')
	 		{
	 			ones.pb(i);
	 		}
	 		else
	 		{
	 			zeroes.pb(i);
	 		}
	 	}
	 	ll len1=ones.size();
	 	ll len2=zeroes.size();
	 	if(len1==0 || len2==0)
        {
            co(s);
            con;
        }
	 	f(0,zeroes.size()-1)
	 	{
	 	    ll high=ones.size()- 1;
            ll low=0;
            ll mid;
            ll f=0;
	 	    while(low<high)
            {
                mid=(low+high)/2;
                if(ones[mid]>zeroes[i])
                {
                    high=mid-1;
                }
                else if(ones[mid]<zeroes[i] && zeroes[i]-ones[mid]<=k)
                {
                    f=1;
                    high=mid;
                }
                else if(ones[mid]<zeroes[i] && zeroes[i]-ones[mid]>k)
                {
                    low=mid+1;
                }
                //cout<<mid<<endl;
            }
            if(f)
            {
                k-=zeroes[i]-ones[mid];
                swap(s[ones[high]],s[zeroes[i]]);
                swap(ones[high],zeroes[i]);
                sort(all(ones));
            }
            /*pv(ones,0,ones.size());
	 		cout<<endl;
	 		pv(zeroes,0,zeroes.size());
	 		cout<<endl;
	 		cout<<s<<endl;
	 		*/
	 	}
	 	co(s);
	 }
	 	/*cout<<"Case #"<<cccc-t<<": ";*/
}


//rohitaas_15
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll  long long
#define int ll
#define rohitaas_15(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define f(a,b) for(int i=a;i<=b;i++)
#define f2(a,b) for(int j=a;j<=b;j++)
#define f3(a,b) for(int k=a;k<=b;k++)
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define ff first
#define ss second
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define co(x) cout<<x<<"\n"
#define pv(v,x,n) f(x,n-1){cout<<v[i]<<" ";}
#define cn(v,x,n) f(x,n){cin>>v[i];}
#define check() cout<<"hi"<<"\n"
#define MOD1 1000000007
#define MOD2 998244353
#define con continue
#define maxv(v) *max_element(all(v));
#define minv(v) *min_element(all(v));
#define sumv(v) accumulate(all(v),0)
#define test() ll t;cin>>t;while(t--)
#define pf pop_front
#define popb pop_back
#define popf pop_front
#define br break
#define rev(x)  reverse(all(x))
#define vr vector<ll>
#define vs vector<string>
#define vd vector<double>
#define vll vector<pii>
#define PI 3.141592653
#define MLL map<ll,ll>
#define yes co("YES");
#define no co("NO");
#define nl cout<<"\n"
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll lcm(ll a , ll b){return (a*b)/ gcd(a,b);}
ll power(ll x, ll y, ll p=LLONG_MAX){ll res = 1;x = x % p;while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}return res;}
double power2(double x, ll y){double res = 1;while (y > 0){if (y & 1)res =(double) (res*x);y = y>>1;x =(double)(x*x);}return res;}
ll modInverse(ll n, ll p){return power(n, p-2, p);}
ll CmP(ll n, ll r, ll p=MOD1){if (r==0)return 1;ll fac[n+1];fac[0] = 1;for (ll i=1 ; i<=n; i++)fac[i] = fac[i-1]*i%p;return (fac[n]* modInverse(fac[r], p) % p *modInverse(fac[n-r], p) % p) % p;}
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> orderedset;
/*find_by_order(ll k)
{returns the iterator to the kth largest element,start from 0,O(logn)}
order_of_key(ll k)
{returns the number of elements in the set which are strictly less than our k,O(logn)}*/
void solve(){

}
void ask(){}
signed main()
{
	 rohitaas_15();
	 int t=1;
	 cin>>t;
	 int cccc=t;
	 while(t--)
	 {
	 	ll n,k;
	 	cin>>n>>k;
	 	string s;
	 	cin>>s;
	 	vr ones,zeroes;
	 	f(0,s.length()-1)
	 	{
	 		if(s[i]=='1')
	 		{
	 			ones.pb(i);
	 		}
	 		else
	 		{
	 			zeroes.pb(i);
	 		}
	 	}
	 	ll len1=ones.size();
	 	ll len2=zeroes.size();
	 	if(len1==0 || len2==0)
        {
            co(s);
            con;
        }
	 	f(0,zeroes.size()-1)
	 	{
	 	    ll high=ones.size()- 1;
            ll low=0;
            ll mid;
            ll f=0;
            ll index=-1;
	 	    while(low<=high)
            {
                mid=(low+high)/2;
                if(ones[mid]>zeroes[i])
                {
                    high=mid-1;
                }
                else if(ones[mid]<zeroes[i] && zeroes[i]-ones[mid]<=k)
                {
                    f=1;
                    index=mid;
                    high=mid-1;
                }
                else if(ones[mid]<zeroes[i] && zeroes[i]-ones[mid]>k)
                {
                    low=mid+1;
                }
                //cout<<mid<<endl;
            }
            if(f)
            {
                k-=zeroes[i]-ones[index];
                swap(s[ones[index]],s[zeroes[i]]);
                swap(ones[index],zeroes[i]);
                sort(all(ones));
            }
           /* pv(ones,0,ones.size());
	 		cout<<endl;
	 		pv(zeroes,0,zeroes.size());
	 		cout<<endl;
	 		cout<<s<<endl;
	 		*/

	 	}
	 	co(s);
	 }
	 	/*cout<<"Case #"<<cccc-t<<": ";*/
}


//rohitaas_15
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll  long long
#define int ll
#define rohitaas_15(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define f(a,b) for(int i=a;i<=b;i++)
#define f2(a,b) for(int j=a;j<=b;j++)
#define f3(a,b) for(int k=a;k<=b;k++)
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define ff first
#define ss second
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define co(x) cout<<x<<"\n"
#define pv(v,x,n) f(x,n-1){cout<<v[i]<<" ";}
#define cn(v,x,n) f(x,n){cin>>v[i];}
#define check() cout<<"hi"<<"\n"
#define MOD1 1000000007
#define MOD2 998244353
#define con continue
#define maxv(v) *max_element(all(v));
#define minv(v) *min_element(all(v));
#define sumv(v) accumulate(all(v),0)
#define test() ll t;cin>>t;while(t--)
#define pf pop_front
#define popb pop_back
#define popf pop_front
#define br break
#define rev(x)  reverse(all(x))
#define vr vector<ll>
#define vs vector<string>
#define vd vector<double>
#define vll vector<pii>
#define PI 3.141592653
#define MLL map<ll,ll>
#define yes co("YES");
#define no co("NO");
#define nl cout<<"\n"
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll lcm(ll a , ll b){return (a*b)/ gcd(a,b);}
ll power(ll x, ll y, ll p=LLONG_MAX){ll res = 1;x = x % p;while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}return res;}
double power2(double x, ll y){double res = 1;while (y > 0){if (y & 1)res =(double) (res*x);y = y>>1;x =(double)(x*x);}return res;}
ll modInverse(ll n, ll p){return power(n, p-2, p);}
ll CmP(ll n, ll r, ll p=MOD1){if (r==0)return 1;ll fac[n+1];fac[0] = 1;for (ll i=1 ; i<=n; i++)fac[i] = fac[i-1]*i%p;return (fac[n]* modInverse(fac[r], p) % p *modInverse(fac[n-r], p) % p) % p;}
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> orderedset;
/*find_by_order(ll k)
{returns the iterator to the kth smallest element,start from 0,O(logn)}
order_of_key(ll k)
{returns the number of elements in the set which are strictly less than our k,O(logn)}*/
void solve(){

}
void ask(){}
signed main()
{
	 rohitaas_15();
	 int t=1;
	 cin>>t;
	 int cccc=t;
	 while(t--)
	 {
	 	ll n,k;
	 	cin>>n>>k;
	 	string s;
	 	cin>>s;
	 	orderedset ones;
	 	vr zeroes;
	 	f(0,s.length()-1)
	 	{
	 		if(s[i]=='1')
	 		{
	 			ones.insert(i);
	 		}
	 		else
	 		{
	 			zeroes.pb(i);
	 		}
	 	}
	 	ll len1=ones.size();
	 	ll len2=zeroes.size();
	 	if(len1==0 || len2==0)
        {
            co(s);
            con;
        }
	 	f(0,zeroes.size()-1)
	 	{
	 	    ll high=ones.size()- 1;
	 	    ll si=ones.size()- 1;
            ll low=0;
            ll mid;
            ll f=0;
            ll index=-1;
	 	    while(low<=high)
            {
                mid=(low+high)/2;
                if(*ones.find_by_order(mid)>zeroes[i])
                {
                    high=mid-1;
                }
                else if(*ones.find_by_order(mid)<zeroes[i] && zeroes[i]-*ones.find_by_order(mid)<=k)
                {
                    f=1;
                    index=mid;
                    high=mid-1;
                }
                else if(*ones.find_by_order(mid)<zeroes[i] && zeroes[i]-*ones.find_by_order(mid)>k)
                {
                    low=mid+1;
                }
                //cout<<*ones.find_by_order(mid)<<endl;
            }
            if(f)
            {
                k-=zeroes[i]-*ones.find_by_order(index);
                swap(s[*ones.find_by_order(index)],s[zeroes[i]]);
                ones.erase(*ones.find_by_order(index));
                ones.insert(zeroes[i]);
                //sort(all(ones));
            }
           // pv(ones,0,ones.size());
	 		/*cout<<endl;
	 		pv(zeroes,0,zeroes.size());
	 		cout<<endl;
	 		cout<<s<<endl;
	 		*/

	 	}
	 	co(s);
	 }
	 	/*cout<<"Case #"<<cccc-t<<": ";*/
}


//rohitaas_15
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll  long long
#define int ll
#define rohitaas_15(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define f(a,b) for(int i=a;i<=b;i++)
#define f2(a,b) for(int j=a;j<=b;j++)
#define f3(a,b) for(int k=a;k<=b;k++)
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define ff first
#define ss second
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define co(x) cout<<x<<"\n"
#define pv(v,x,n) f(x,n-1){cout<<v[i]<<" ";}
#define cn(v,x,n) f(x,n){cin>>v[i];}
#define check() cout<<"hi"<<"\n"
#define MOD1 1000000007
#define MOD2 998244353
#define con continue
#define maxv(v) *max_element(all(v));
#define minv(v) *min_element(all(v));
#define sumv(v) accumulate(all(v),0)
#define test() ll t;cin>>t;while(t--)
#define pf pop_front
#define popb pop_back
#define popf pop_front
#define br break
#define rev(x)  reverse(all(x))
#define vr vector<ll>
#define vs vector<string>
#define vd vector<double>
#define vll vector<pii>
#define PI 3.141592653
#define MLL map<ll,ll>
#define yes co("YES");
#define no co("NO");
#define nl cout<<"\n"
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll lcm(ll a , ll b){return (a*b)/ gcd(a,b);}
ll power(ll x, ll y, ll p=LLONG_MAX){ll res = 1;x = x % p;while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}return res;}
double power2(double x, ll y){double res = 1;while (y > 0){if (y & 1)res =(double) (res*x);y = y>>1;x =(double)(x*x);}return res;}
ll modInverse(ll n, ll p){return power(n, p-2, p);}
ll CmP(ll n, ll r, ll p=MOD1){if (r==0)return 1;ll fac[n+1];fac[0] = 1;for (ll i=1 ; i<=n; i++)fac[i] = fac[i-1]*i%p;return (fac[n]* modInverse(fac[r], p) % p *modInverse(fac[n-r], p) % p) % p;}
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> orderedset;
/*find_by_order(ll k)
{returns the iterator to the kth largest element,start from 0,O(logn)}
order_of_key(ll k)
{returns the number of elements in the set which are strictly less than our k,O(logn)}*/
void solve(){

}
void ask(){}
signed main()
{
	 rohitaas_15();
	 int t=1;
	 cin>>t;
	 int cccc=t;
	 while(t--)
	 {
	 	ll n,k;
	 	cin>>n>>k;
	 	string s;
	 	cin>>s;
	 	vr ones,zeroes;
	 	f(0,s.length()-1)
	 	{
	 		if(s[i]=='1')
	 		{
	 			ones.pb(i);
	 		}
	 		else
	 		{
	 			zeroes.pb(i);
	 		}
	 	}
	 	ll prev=0;
	 	ll i=0;
	 	f(0,zeroes.size()-1)
	 	{
                    while(ones[prev]>zeroes[i])
                    {
                        i++;
                    }
                    while(!(zeroes[i]-ones[prev]<=k) && prev<ones.size())
                    {
                        prev++;
                    }
                    if(prev==ones.size())
                    {
                        br;
                    }
                    if(ones[prev]<zeroes[i])
                    {
                        k-=(zeroes[i]-ones[prev]);
                        swap(s[zeroes[i]],s[ones[prev]]);
                        swap(zeroes[i],ones[prev]);
                        sort(all(ones));
                    }
                    prev=0;
	 		/*pv(ones,0,ones.size());
	 		cout<<endl;
	 		pv(zeroes,0,zeroes.size());
	 		cout<<endl;
	 		cout<<s<<endl;
	 		*/

	 	}
	 	co(s);
	 }
	 	/*cout<<"Case #"<<cccc-t<<": ";*/
}


//rohitaas_15
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll  long long
#define int ll
#define rohitaas_15(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define f(a,b) for(int i=a;i<=b;i++)
#define f2(a,b) for(int j=a;j<=b;j++)
#define f3(a,b) for(int k=a;k<=b;k++)
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define ff first
#define ss second
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define co(x) cout<<x<<"\n"
#define pv(v,x,n) f(x,n-1){cout<<v[i]<<" ";}
#define cn(v,x,n) f(x,n){cin>>v[i];}
#define check() cout<<"hi"<<"\n"
#define MOD1 1000000007
#define MOD2 998244353
#define con continue
#define maxv(v) *max_element(all(v));
#define minv(v) *min_element(all(v));
#define sumv(v) accumulate(all(v),0)
#define test() ll t;cin>>t;while(t--)
#define pf pop_front
#define popb pop_back
#define popf pop_front
#define br break
#define rev(x)  reverse(all(x))
#define vr vector<ll>
#define vs vector<string>
#define vd vector<double>
#define vll vector<pii>
#define PI 3.141592653
#define MLL map<ll,ll>
#define yes co("YES");
#define no co("NO");
#define nl cout<<"\n"
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll lcm(ll a , ll b){return (a*b)/ gcd(a,b);}
ll power(ll x, ll y, ll p=LLONG_MAX){ll res = 1;x = x % p;while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}return res;}
double power2(double x, ll y){double res = 1;while (y > 0){if (y & 1)res =(double) (res*x);y = y>>1;x =(double)(x*x);}return res;}
ll modInverse(ll n, ll p){return power(n, p-2, p);}
ll CmP(ll n, ll r, ll p=MOD1){if (r==0)return 1;ll fac[n+1];fac[0] = 1;for (ll i=1 ; i<=n; i++)fac[i] = fac[i-1]*i%p;return (fac[n]* modInverse(fac[r], p) % p *modInverse(fac[n-r], p) % p) % p;}
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> orderedset;
/*find_by_order(ll k)
{returns the iterator to the kth smallest element,start from 0,O(logn)}
order_of_key(ll k)
{returns the number of elements in the set which are strictly less than our k,O(logn)}*/
void solve(){

}
void ask(){}
signed main()
{
	 rohitaas_15();
	 int t=1;
	 cin>>t;
	 int cccc=t;
	 while(t--)
	 {
	 	ll n,k;
	 	cin>>n>>k;
	 	string s;
	 	cin>>s;
	 	orderedset ones;
	 	vr zeroes;
	 	f(0,s.length()-1)
	 	{
	 		if(s[i]=='1')
	 		{
	 			ones.insert(i);
	 		}
	 		else
	 		{
	 			zeroes.pb(i);
	 		}
	 	}
	 	ll len1=ones.size();
	 	ll len2=zeroes.size();
	 	if(len1==0 || len2==0)
        {
            co(s);
            con;
        }
	 	f(0,zeroes.size()-1)
	 	{
	 	    if(k==0)
            {
                br;
            }
	 	    ll high=ones.size()- 1;
	 	    ll si=ones.size()- 1;
            ll low=0;
            ll mid;
            ll f=0;
            ll index=-1;
	 	    while(low<=high)
            {
                mid=(low+high)/2;
                if(*ones.find_by_order(mid)>zeroes[i])
                {
                    high=mid-1;
                }
                else if(*ones.find_by_order(mid)<zeroes[i] && zeroes[i]-*ones.find_by_order(mid)<=k)
                {
                    f=1;
                    index=mid;
                    high=mid-1;
                }
                else if(*ones.find_by_order(mid)<zeroes[i] && zeroes[i]-*ones.find_by_order(mid)>k)
                {
                    low=mid+1;
                }
                //cout<<*ones.find_by_order(mid)<<endl;
            }
            if(f)
            {
                k-=zeroes[i]-*ones.find_by_order(index);
                swap(s[*ones.find_by_order(index)],s[zeroes[i]]);
                ones.erase(*ones.find_by_order(index));
                ones.insert(zeroes[i]);
                //sort(all(ones));
            }
           // pv(ones,0,ones.size());
	 		/*cout<<endl;
	 		pv(zeroes,0,zeroes.size());
	 		cout<<endl;
	 		cout<<s<<endl;
	 		*/

	 	}
	 	co(s);
	 }
	 	/*cout<<"Case #"<<cccc-t<<": ";*/
}


//rohitaas_15
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll  long long
#define int ll
#define rohitaas_15(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define f(a,b) for(int i=a;i<=b;i++)
#define f2(a,b) for(int j=a;j<=b;j++)
#define f3(a,b) for(int k=a;k<=b;k++)
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define ff first
#define ss second
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define co(x) cout<<x<<"\n"
#define pv(v,x,n) f(x,n-1){cout<<v[i]<<" ";}
#define cn(v,x,n) f(x,n){cin>>v[i];}
#define check() cout<<"hi"<<"\n"
#define MOD1 1000000007
#define MOD2 998244353
#define con continue
#define maxv(v) *max_element(all(v));
#define minv(v) *min_element(all(v));
#define sumv(v) accumulate(all(v),0)
#define test() ll t;cin>>t;while(t--)
#define pf pop_front
#define popb pop_back
#define popf pop_front
#define br break
#define rev(x)  reverse(all(x))
#define vr vector<ll>
#define vs vector<string>
#define vd vector<double>
#define vll vector<pii>
#define PI 3.141592653
#define MLL map<ll,ll>
#define yes co("YES");
#define no co("NO");
#define nl cout<<"\n"
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll lcm(ll a , ll b){return (a*b)/ gcd(a,b);}
ll power(ll x, ll y, ll p=LLONG_MAX){ll res = 1;x = x % p;while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}return res;}
double power2(double x, ll y){double res = 1;while (y > 0){if (y & 1)res =(double) (res*x);y = y>>1;x =(double)(x*x);}return res;}
ll modInverse(ll n, ll p){return power(n, p-2, p);}
ll CmP(ll n, ll r, ll p=MOD1){if (r==0)return 1;ll fac[n+1];fac[0] = 1;for (ll i=1 ; i<=n; i++)fac[i] = fac[i-1]*i%p;return (fac[n]* modInverse(fac[r], p) % p *modInverse(fac[n-r], p) % p) % p;}
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> orderedset;
/*find_by_order(ll k)
{returns the iterator to the kth largest element,start from 0,O(logn)}
order_of_key(ll k)
{returns the number of elements in the set which are strictly less than our k,O(logn)}*/
void solve(){

}
void ask(){}
signed main()
{
	 rohitaas_15();
	 int t=1;
	 cin>>t;
	 int cccc=t;
	 while(t--)
	 {
	 	ll n,k;
	 	cin>>n>>k;
	 	string s;
	 	cin>>s;
	 	vr ones,zeroes;
	 	f(0,s.length()-1)
	 	{
	 		if(s[i]=='1')
	 		{
	 			ones.pb(i);
	 		}
	 		else
	 		{
	 			zeroes.pb(i);
	 		}
	 	}
	 	f(0,zeroes.size()-1)
	 	{
	 	    ll high=ones.size()- 1;
            ll low=0;
            ll mid;
            ll f=0;
	 	    while(low<high)
            {
                mid=(low+high)/2;
                if(ones[mid]>zeroes[i])
                {
                    high=mid-1;
                }
                else if(ones[mid]<zeroes[i] && zeroes[i]-ones[mid]<=k)
                {
                    f=1;
                    high=mid;
                }
                else if(ones[mid]<zeroes[i] && zeroes[i]-ones[mid]>k)
                {
                    low=mid+1;
                }
                //cout<<mid<<endl;
            }
            if(f)
            {
                k-=zeroes[i]-ones[mid];
                swap(s[ones[high]],s[zeroes[i]]);
                swap(ones[high],zeroes[i]);
                sort(all(ones));
            }
            /*pv(ones,0,ones.size());
	 		cout<<endl;
	 		pv(zeroes,0,zeroes.size());
	 		cout<<endl;
	 		cout<<s<<endl;
	 		*/
	 	}
	 	co(s);
	 }
	 	/*cout<<"Case #"<<cccc-t<<": ";*/
}


#include <iostream>
#include <cstdio>
#include <cmath>

typedef long long ll;

using namespace std;

bool isprime(ll n)
{
	ll m=(ll)sqrt(n+0.5);
	for(ll i=2;i<=m;++i)
		if(n%i==0) return false;
	return true;
}

ll gcd(ll a,ll b)
{
	return b==0 ? a : gcd(b,a%b);
}

int main()
{
	int t;
	ll n;
	cin>>t;
	while(t--)
	{
		cin>>n;
		ll u=n,v=n+1;
		while(!isprime(u))
			--u;
		while(!isprime(v))
			++v;
		ll q=u*v-2*v-2*u+2*n+2,p=2*u*v;
		ll t=gcd(q,p);
		cout<<q/t<<"/"<<p/t<<endl;
	}
	return 0;
}


//In the name of God

#include <iostream>
#include <algorithm>
using namespace std;

bool prime(long long x)
{
  if(x==1)
    return false;
  for(int i=2;i*i<=x;i++)
    if(x%i==0)
      return false;
  return true;
}

int main()
{
  #define int long long
  int t;
  cin>>t;
  for(int i=1;i<=t;i++)
    {
      int n;
      cin>>n;
      if(n==2)
	cout<<"1/6"<<endl;
      else
	{
	  int a=0,b=0;
	  for(int j=n;1;j--)
	    if(prime(j))
	      {
		b=j;
		break;
	      }
	  for(int j=n+1;1;j++)
	    if(prime(j))
	      {
		a=j;
		break;
	      }
	  int ans=a*b+2*(n-a-b+1);
	  cout<<ans/__gcd(ans,2*a*b)<<"/"<<2*a*b/__gcd(ans,2*a*b)<<endl;
	}
    }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

typedef long long LL;
LL prime[100000];
LL n;
int tot;
bool isP[100010];

void init(){
    tot=0;
    memset(isP,1,sizeof(isP));
    for (int i=2;i<=100000;i++){
        if (isP[i]){
            prime[tot++]=i;
            for (int j=i;j<=100000;j+=i){
                isP[j]=0;
            }
        }
    }
}

LL gcd(LL x,LL y){
    if (y==0)
        return x;
    return gcd(y,x%y);
}

int main(){
    init();
    int t;
    scanf("%d",&t);
    for (int i=0;i<t;i++){
        scanf("%I64d",&n);
        LL l=0,r=0;
        for (LL i=n;i;i--){
            bool flag=0;
            for (int j=0;j<tot && prime[j]<i;j++){
                if (i%prime[j]==0){
                    flag=1;
                    break;
                }
            }
            if (!flag){
                l=i;
                break;
            }
        }
        for (LL i=n+1;i;i++){
            bool flag=0;
            for (int j=0;j<tot && prime[j]<i;j++){
                if (i%prime[j]==0){
                    flag=1;
                    break;
                }
            }
            if (!flag){
                r=i;
                break;
            }
        }
//        cout<<l<<' '<<r<<endl;
        LL s,m;
        s=r*(l-2)+2*(n-l+1);
        m=2*l*r;
        LL g=gcd(s,m);
        printf("%I64d/%I64d\n",s/g,m/g);
    }
}


#include<iostream>
#include<cstdio>
#define lld long long
using namespace std;

int Pow(int a,int b,int p) // a ^ b mod p
{
	if(!b) return 1;
	int tmp = Pow(a, b >> 1, p);
	tmp = ((lld)tmp * (lld)tmp) % p;
	if(b & 1) tmp = ((lld)tmp * (lld)a) % p;
	return tmp;
}

bool prime(int x)
{
	if(x == 2 || x == 3 || x == 5 || x == 7) return true;
	if(x <= 7) return false;
	return (Pow(2, x - 1, x) == 1 &&
			Pow(3, x - 1, x) == 1 &&
			Pow(5, x - 1, x) == 1 &&
			Pow(7, x - 1, x) == 1);
}

int T;
lld gcd(lld a,lld b)
{
	if(!b) return a;
	return gcd(b, a % b);
}

struct FS
{
	lld fz, fm;
	FS(lld fz = 0,lld fm = 1):fz(fz),fm(fm){}
	void maintain()
	{
		lld gd = gcd(fz, fm);
		fz /= gd;fm /= gd;
	}
	FS operator - (const FS &b) const
	{
		FS ret;
		lld gd = gcd(fm, b.fm);
		ret.fz = fz * (b.fm / gd) - b.fz * (fm / gd);
		ret.fm = fm * (b.fm / gd);
		ret.maintain();
		return ret;
	}
	FS operator + (const FS &b) const
	{
		FS ret;
		lld gd = gcd(fm, b.fm);
		ret.fz = fz * (b.fm / gd) + b.fz * (fm / gd);
		ret.fm = fm * (b.fm / gd);
		ret.maintain();
		return ret;
	}
}ans;
int n, last, nxt;
int findLast(int v)
{
	for(int i = v; i >= 2; --i)
		if(prime(i)) return i;
	return 0;
}
int findNext(int v)
{
	for(int i = v; ; ++i)
		if(prime(i)) return i;
	return 0;
}
int main()
{
	scanf("%d", &T);
	while(T--)
	{
		scanf("%d", &n);
		last = findLast(n);
		nxt = findNext(n + 1);
		ans = FS(1, 2) - FS(1, last);
		for(int i = last; i <= n; ++i)
			ans = ans + FS(1, (lld)last * (lld)nxt);
		cout << ans.fz << "/" << ans.fm << endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#define lld long long
using namespace std;

int Pow(int a,int b,int p) // a ^ b mod p
{
	if(!b) return 1;
	int tmp = Pow(a, b >> 1, p);
	tmp = ((lld)tmp * (lld)tmp) % p;
	if(b & 1) tmp = ((lld)tmp * (lld)a) % p;
	return tmp;
}

bool prime(int x)
{
	if(x == 2 || x == 3 || x == 5 || x == 7) return true;
	if(x <= 7) return false;
	return (Pow(2, x - 1, x) == 1 &&
			Pow(3, x - 1, x) == 1 &&
			Pow(5, x - 1, x) == 1 &&
			Pow(7, x - 1, x) == 1);
}

int T;
lld gcd(lld a,lld b)
{
	if(!b) return a;
	return gcd(b, a % b);
}

struct FS
{
	lld fz, fm;
	FS(lld fz = 0,lld fm = 1):fz(fz),fm(fm){}
	FS operator - (const FS &b) const
	{
		FS ret;
		lld gd = gcd(fm, b.fm);
		ret.fz = fz * (b.fm / gd) - b.fz * (fm / gd);
		ret.fm = fm * (b.fm / gd);
		return ret;
	}
	FS operator + (const FS &b) const
	{
		FS ret;
		lld gd = gcd(fm, b.fm);
		ret.fz = fz * (b.fm / gd) + b.fz * (fm / gd);
		ret.fm = fm * (b.fm / gd);
		return ret;
	}
}ans;
int n, last, nxt;
int findLast(int v)
{
	for(int i = v; i >= 2; --i)
		if(prime(i)) return i;
	return 0;
}
int findNext(int v)
{
	for(int i = v; ; ++i)
		if(prime(i)) return i;
	return 0;
}
int main()
{
	scanf("%d", &T);
	while(T--)
	{
		scanf("%d", &n);
		last = findLast(n);
		nxt = findNext(n + 1);
		ans = FS(1, 2) - FS(1, last);
		for(int i = last; i <= n; ++i)
			ans = ans + FS(1, (lld)last * (lld)nxt);
		cout << ans.fz << "/" << ans.fm << endl;
	}
	return 0;
}


#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;

const int MAXN = 550;
map <int,int> qtd;
int total, primo[100100];

bool mrk[100100];

void achaprimos() {
    total = 0;
    bool flag = false;
    for (int i=3; i*i <= (int)1E9; i+=2) {
        if (!mrk[i]) {
            primo[++total] = i;
            if (flag) continue;
            if (i*i*i*i > (int)1E9) {
                flag = true;
                continue;
            }
            for (int k=i*i; k*k<=(int)1E9; k+=2*i) mrk[k] = true;
        }
    }
}

bool ehprimo(int N) {
    if (N == 1) return false;
    if (N == 2) return true;
    if (N%2 == 0) return false;
    for (int i=1; (i<=total && primo[i]*primo[i] <= N); i++) if (N%primo[i] == 0) return false;
    return true;
}

long long int gcd(long long int a, long long int b) {
    if (a < b) swap(a,b);
    if (b == 0LL) return a;
    return gcd(b,a%b);
}

int antes(int N) {
    int resp = N;
    while (!ehprimo(resp)) resp--;
    return resp;
}

int depois(int N) {
    int resp = N+1;
    while (!ehprimo(resp)) resp++;
    return resp;
}

void f(int N) {
    if (N == 2) printf("1/6\n");
    else if (N == 3) printf("7/30\n");
    else if (N == 4) printf("9/30\n");
    else {
    long long int pa, pb, resp;
    pa = antes(N);
    pb = depois(N);
    resp = (pa*pb-2*pa);
    resp -= ((pb-N-1)*2);
    long long int denominador;
    denominador = (pa*pb*2);
    long long int mdc = gcd(resp,denominador);
    resp /= mdc;
    denominador /= mdc;
    printf("%I64d/%I64d\n",resp,denominador);
    }
}

int main() {
    achaprimos();
    int T, N;
    scanf("%d",&T);
    while (T--) {
        scanf("%d",&N);
        f(N);
    }
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;

const int MAXN = 550;
map <int,int> qtd;
int total, primo[100100];

bool mrk[100100];

void achaprimos() {
    total = 0;
    bool flag = false;
    for (int i=3; i*i <= (int)1E9; i+=2) {
        if (!mrk[i]) {
            primo[++total] = i;
            if (flag) continue;
            if (i*i*i*i > (int)1E9) {
                flag = true;
                continue;
            }
            for (int k=i*i; k*k<=(int)1E9; k+=2*i) mrk[k] = true;
        }
    }
}

bool ehprimo(int N) {
    if (N == 1) return false;
    if (N == 2) return true;
    if (N%2 == 0) return false;
    for (int i=1; (i<=total && primo[i]*primo[i] <= N); i++) if (N%primo[i] == 0) return false;
    return true;
}

long long int gcd(long long int a, long long int b) {
    if (a < b) swap(a,b);
    if (b == 0LL) return a;
    return gcd(b,a%b);
}

int antes(int N) {
    int resp = N;
    while (!ehprimo(resp)) resp--;
    return resp;
}

int depois(int N) {
    int resp = N+1;
    while (!ehprimo(resp)) resp++;
    return resp;
}

void f(int N) {
    if (N == 2) printf("1/6\n");
    else if (N == 3) printf("7/30\n");
    else if (N == 4) printf("3/10\n");
    else {
    long long int pa, pb, resp;
    pa = antes(N);
    pb = depois(N);
    resp = (pa*pb-2*pa);
    resp -= ((pb-N-1)*2);
    long long int denominador;
    denominador = (pa*pb*2);
    long long int mdc = gcd(resp,denominador);
    resp /= mdc;
    denominador /= mdc;
    printf("%I64d/%I64d\n",resp,denominador);
    }
}

int main() {
    achaprimos();
    int T, N;
    scanf("%d",&T);
    while (T--) {
        scanf("%d",&N);
        f(N);
    }
    return 0;
}


#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#define FOR(i,n) for(i=0;i<(n);i++)
#define CLR(a) memset(a,0,sizeof(a))
#define CIN(a) scanf("%d",&a)
using namespace std;
int IsPrime(int m)
{
   int k,i;
   if(m<=1) return 0;/*负数和0,1都不是素数*/
   k=sqrt(m);
   for(i=2;i<=k;i++)
      if(m%i==0) return 0;
   return 1;/*是素数*/
}
long long GCD(long long a,long long b)
{
    return (b>0)?GCD(b,a%b):a;
}

int main()
{
	int t,k;
	int p1,p2;
	cin>>t;
	while(t--)
    {
        scanf("%d",&k);
        for(p1=k;!IsPrime(p1);p1--);
        for(p2=k+1;!IsPrime(p2);p2++);
        //printf("%d~%d\n",p1,p2);
        long long fz=1LL*p1*p2-2*p2-2*p1+2*k+2;
        long long fm=1LL*2*p1*p2;
        long long gcd=GCD(fz,fm);
        printf("%I64d/",fz/gcd);
        printf("%I64d\n",fm/gcd);
    }
	return 0;
}


#include <stdio.h>
#include <string.h>
#include<math.h>
#include <iostream>
using namespace std;
const int N = 100005;

int cnt, prime[N], flag[N];
long long u,v,p,q,d;

int isPrime (int k)
{
    for(int i=2;i<=sqrt((double)k);i++)
        if(k%i==0)
           return 0;
        else
           return 1;
}

int under (int n)
{
    for (int i = n; i >= 2; i--)
        if (isPrime(i))
            return i;
    return 0;
}

int up (int n)
{
    for (int i = n + 1; i; i++)
        if (isPrime(i))
            return i;
    return 0;
}

int gcd(long long  p, long long q)
{
    if (!q)
        return p;
    else
        return gcd(q,p%q);
}

int main ()
{
    int tcase, n;
    scanf("%d", &tcase);
    while (tcase--)
    {
        scanf("%d",&n);
        cnt = 0;
        memset(flag, 0, sizeof(flag));
        for (int i = 2; i < N; i++)
        {
            if (!flag[i])
             {
                prime[cnt++] = i;
                for (int j = i*2; j < N; j += i)
                    flag[j] = 1;
             }
         }
         v = under(n);u = up(n);
         p = u*v + 2*(n-v-u+1);
         q = 2*u*v;
         d = gcd(p,q);
        cout << p/d << "/" << q/d << endl;
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include<math.h>
#include <iostream>
using namespace std;
const int N = 100005;

int cnt, prime[N], flag[N];
long long u,v,p,q,d;

int isPrime (int k)
{
    int t=sqrt((double)k);
    for(int i=2;i<=t;i++)
        if(k%i==0)
        return 0;
    else
        return 1;
}

int under (int n)
{
    for (int i = n; i >= 2; i--)
        if (isPrime(i))
            return i;
    return 0;
}

int up (int n)
{
    for (int i = n + 1; i; i++)
        if (isPrime(i))
            return i;
    return 0;
}

int gcd(long long  p, long long q)
{
    if (!q)
        return p;
    else
        return gcd(q, p%q);
}

int main ()
{
    int tcase, n;
    scanf("%d", &tcase);
    while (tcase--)
    {
        scanf("%d",&n);
        cnt = 0;
        memset(flag, 0, sizeof(flag));
        for (int i = 2; i < N; i++)
        {
            if (!flag[i])
             {
                prime[cnt++] = i;
                for (int j = i*2; j < N; j += i)
                    flag[j] = 1;
             }
         }
        /*
        for (int i = n; i >= 2; i--)
        {
          if (isPrime(i))
              v=i;break;
        }

        for (int i = n + 1; i; i++)
        {
          if (isPrime(i))
             u=i;break;
        }*/
         v = under(n);u = up(n);
         p = u*v + 2*(n-v-u+1);
         q = 2*u*v;
         d = gcd(p,q);
        cout << p/d << "/" << q/d << endl;
    }
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
typedef long long ll;
const int N = 1e5+10;
int cnt, prime[N], flag[N];
long long u,v,p,q,d;

int isPrime (int k)
{
    if (k < N)
        return !flag[k];
    for (int i = 0; i <cnt && prime[i] <= k; i++)
        if (k%prime[i] == 0)
           return 0;
    return 1;
}

ll under (int n)
{
    for (int i = n; i >= 2; i--)
        if (isPrime(i))
            return i;
    return 0;
}

ll up (int n)
{
    for (int i = n + 1; i; i++)
        if (isPrime(i))
            return i;
    return 0;
}

int gcd(ll p, ll q)
{
    if (!q)
        return p;
    else
        return gcd(q, p%q);
}

int main ()
{
    int tcase, n;
    scanf("%d", &tcase);
    while (tcase--)
    {
        scanf("%d", &n);
        cnt = 0;
        memset(flag, 0, sizeof(flag));
        for (int i = 2; i < N; i++)
        {
            if (!flag[i])
             {
                prime[cnt++] = i;
                for (int j = i*2; j < N; j += i)
                    flag[j] = 1;
             }
         }
        /*
        for (int i = n; i >= 2; i--)
        {
          if (isPrime(i))
              v=i;break;
        }

        for (int i = n + 1; i; i++)
        {
          if (isPrime(i))
             u=i;break;
        }*/
         v = under(n);u = up(n);
         p = u*v + 2*(n-v-u+1);
         q = 2*u*v;
         d = gcd(p,q);
        cout << p/d << "/" << q/d << endl;
    }
    return 0;
}


#include<stdio.h>
#include<queue>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
using namespace std;
typedef long long LL;
const int maxn=1010;
bool pr(int v){
    for(int i=2;i<=32000&&i<v;i++){
        if(v%i==0)
            return false;
    }
    return true;
}
LL gcd(LL a,LL b){
    return b==0?a:gcd(b,a%b);
}
LL lcm(LL a,LL b){
    return a*gcd(a,b)/b;
}
int main(){
  int n,t;
  cin>>t;
  while(t--){
  cin>>n;
  LL z,w;
  for(int i=n;i>=max(2,n-1000);i--){
    if(pr(i)){
        z=i;
        break;
    }
  }
  for(int i=z+1;i<=z+1001;i++){
    if(pr(i))
    {
        w=i;
        break;
    }
  }
  LL bo=w*2*z;
  LL top=bo/(2*z)*(z-2)+bo/(w*z)*(n-z+1);
  LL div=gcd(bo,top);
  top/=div;
  bo/=div;
  cout<<top<<"/"<<bo<<endl;
  }
}


#include<cstdio>
typedef long long ll;
ll mdc(ll a,ll b){
    if(a%b==0)return a;
    else return mdc(b,a%b);
}
bool prime(ll a){
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return 0;
    }
    return 1;
}
int main(){
    int T;
    scanf("%d",&T);
    for(int i=0;i<T;i++){
        ll N;
        scanf("%I64d",&N);
        ll aux1=N;
        ll aux2=N+1;
        while(!prime(aux1)){
           aux1--;
        }
        while(!prime(aux2)){
           aux2++;
        }
        ll num,den;
        if(N==2){
            num=aux2-2;
            den=2*aux2;
        }
        else{
            num=aux2*(aux1-2)+2*(N-aux1+1);
            den=2*aux1*aux2;
        }
        printf("%I64d/%I64d\n",num,den);
        int m=mdc(num,den);
        num/=m;
        den/=m;

    }
    scanf("%.d");
}


#include<cstdio>
typedef long long ll;
ll mdc(ll a,ll b){
    if(a%b==0)return b;
    else return mdc(b,a%b);
}
bool prime(ll a){
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return 0;
    }
    return 1;
}
int main(){
    int T;
    scanf("%d",&T);
    for(int i=0;i<T;i++){
        ll N;
        scanf("%I64d",&N);
        ll aux1=N;
        ll aux2=N+1;
        while(!prime(aux1)){
           aux1--;
        }
        while(!prime(aux2)){
           aux2++;
        }
        ll num,den;
        if(N==2){
            num=aux2-2;
            den=2*aux2;
        }
        else{
            num=aux2*(aux1-2)+2*(N-aux1+1);
            den=2*aux1*aux2;
        }
        int m=mdc(num,den);
        num/=m;
        den/=m;
        printf("%I64d/%I64d\n",num,den);
    }
    scanf("%.d");
}


#include <bits/stdc++.h>

const int MAXN=1000000002;
using namespace std;
int t,n;

bool is_prime(long long);
long long GCD(long long,long long);

int main()
{
	std::ios::sync_with_stdio(false);
	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);

		long long gcd=GCD(num,deno);
		num/=gcd;
		deno/=gcd;
		cout << deno << "/" << num << endl;
	}

	return 0;
}

bool is_prime(long long x)
{

	bool f=true;
	int most=sqrt(x);
	for (int i=2;i<=most;i++) if (x % i==0) return false;
	return !(x<2);
/*
	for(long long i=2;i*i<=x;i++) if(x%i==0)return 0;
	return !(x<2);
*/
}

long long GCD(long long x,long long y)
{
	while (x%y!=0)
	{
		long long z=x%y;
		x=y;y=z;
	}
	return y;
}


#include <bits/stdc++.h>

const int MAXN=1000000002;
using namespace std;
int t,n;
//bool f[MAXN];

//vector<int> prime;
bool is_prime(long long);

int main()
{
	std::ios::sync_with_stdio(false);
/*
	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);
	prime.push_back(1000000007);
*/
	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);
		cout << deno << "/" <<num<<endl;
	}

	return 0;
}

bool is_prime(long long x)
{
	bool f=true;
	int most=sqrt(x);
	for (int i=2;i<=most;i++) if (x % i==0) f=false;
	return f;
}


#include <bits/stdc++.h>

const int MAXN=1000000002;
using namespace std;
int t,n;

bool is_prime(long long);
long long GCD(long long,long long);

int main()
{
	std::ios::sync_with_stdio(false);
	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);

		long long gcd=GCD(num,deno);
		num/=gcd;
		deno/=gcd;
		cout << deno << "/" << num << endl;
	}

	return 0;
}

bool is_prime(long long x)
{
/*
	bool f=true;
	int most=sqrt(x);
	for (int i=2;i<=most;i++) if (x % i==0) f=false;
	return f;
*/
	for(long long i=2;i*i<=x;i++) if(x%i==0)return 0;
	return !(x<2);
}

long long GCD(long long x,long long y)
{
	while (x%y!=0)
	{
		long long z=x%y;
		x=y;y=z;
	}
	return y;
}


#include <bits/stdc++.h>

const int MAXN=40000;
using namespace std;
int t,n;
bool f[100005];

vector<int> prime;
bool is_prime(long long);
long long GCD(long long,long long);

int main()
{
	std::ios::sync_with_stdio(false);

	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);

	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);

		long long gcd=GCD(num,deno);
		num/=gcd;
		deno/=gcd;
		cout << deno << "/" << num << endl;
	}

	return 0;
}

bool is_prime(long long x)
{
	bool f=true;

	for (int i=0;i<prime.size();i++) if (x!=prime[i] && x % prime[i]==0) f=false;

	return f;
}

long long GCD(long long x,long long y)
{
	while (x%y!=0)
	{
		long long z=x%y;
		x=y;y=z;
	}
	return y;
}


#include <bits/stdc++.h>

const int MAXN=31700;
using namespace std;
int t,n;
bool f[MAXN+5];

vector<int> prime;
bool is_prime(long long);
long long GCD(long long,long long);

int main()
{
	std::ios::sync_with_stdio(false);

	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);

	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);

		long long gcd=GCD(num,deno);
		num/=gcd;
		deno/=gcd;
		cout << deno << "/" << num << endl;
	}

	return 0;
}

inline bool is_prime(long long x)
{
	bool f=true;

	for (int i=0;i<prime.size();i++) if (x!=prime[i] && x % prime[i]==0) f=false;

	return f;
}

long long GCD(long long x,long long y)
{
	while (x%y!=0)
	{
		long long z=x%y;
		x=y;y=z;
	}
	return y;
}


#include <bits/stdc++.h>

const int MAXN=1000000002;
using namespace std;
int t,n;
//bool f[MAXN];

//vector<int> prime;
bool is_prime(long long);

int main()
{
	std::ios::sync_with_stdio(false);
/*
	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);
	prime.push_back(1000000007);
*/
	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);
		cout << deno << "/" << num <<endl;
	}

	return 0;
}

bool is_prime(long long x)
{
	bool f=true;
	int most=sqrt(x);
	for (int i=2;i<=most;i++) if (x % i==0) f=false;
	return f;
}


#include <bits/stdc++.h>

const int MAXN=1000000002;
using namespace std;
int t,n;
//bool f[MAXN];

//vector<int> prime;
bool is_prime(long long);
long long GCD(long long,long long);

int main()
{
	std::ios::sync_with_stdio(false);
/*
	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);
	prime.push_back(1000000007);
*/
	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);

		long long gcd=GCD(num,deno);
		num/=gcd;
		deno/=gcd;
		cout << deno << "/" << num << endl;
	}

	return 0;
}

bool is_prime(long long x)
{
	bool f=true;
	int most=sqrt(x);
	for (int i=2;i<=most;i++) if (x % i==0) f=false;
	return f;
}

long long GCD(long long x,long long y)
{
	while (x%y!=0)
	{
		long long z=x%y;
		x=y;y=z;
	}
	return y;
}


#include <bits/stdc++.h>

const int MAXN=1000000002;
using namespace std;
int t,n;
//bool f[MAXN];

//vector<int> prime;
bool is_prime(long long);

int main()
{
	std::ios::sync_with_stdio(false);
/*
	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);
	prime.push_back(1000000007);
*/
	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);
		cout << deno << "/" << num << endl;
	}

	return 0;
}

bool is_prime(long long x)
{
	bool f=true;
	int most=sqrt(x);
	for (int i=2;i<=most;i++) if (x % i==0) f=false;
	return f;
}


#include <bits/stdc++.h>

const int MAXN=31700;
using namespace std;
int t,n;
bool f[MAXN+5];

vector<int> prime;
bool is_prime(long long);
long long GCD(long long,long long);

int main()
{
	std::ios::sync_with_stdio(false);

	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);

	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);

		long long gcd=GCD(num,deno);
		num/=gcd;
		deno/=gcd;
		cout << deno << "/" << num << endl;
	}

	return 0;
}

inline bool is_prime(long long x)
{
	for (int i=0;i<prime.size();i++) if (x!=prime[i] && x % prime[i]==0) return false;
	return !(x<2);
}

long long GCD(long long x,long long y)
{
	while (x%y!=0)
	{
		long long z=x%y;
		x=y;y=z;
	}
	return y;
}


#include <bits/stdc++.h>

const int MAXN=1000000002;
using namespace std;
int t,n;
//bool f[MAXN];

//vector<int> prime;
bool is_prime(long long);

int main()
{
	std::ios::sync_with_stdio(false);
/*
	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);
	prime.push_back(1000000007);
*/
	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);
		cout << deno << "/" << num;
	}

	return 0;
}

bool is_prime(long long x)
{
	bool f=true;
	int most=sqrt(x);
	for (int i=2;i<=most;i++) if (x % i==0) f=false;
	return f;
}


#include <bits/stdc++.h>

const int MAXN=100005;
using namespace std;
int t,n;
bool f[100005];

vector<int> prime;
bool is_prime(long long);
long long GCD(long long,long long);

int main()
{
	std::ios::sync_with_stdio(false);

	memset(f,true,sizeof(f));

	int most=sqrt(MAXN);
	for (int i=3;i<=most;i+=2)
	{
		if (f[i]==true)
		{
			for (int j=i*i;j<=MAXN;j+=i << 1) f[j]=false;
		}
	}

	prime.push_back(2);
	for (int i=3;i<=MAXN;i+=2) if (f[i]) prime.push_back(i);

	cin >> t;
	while (t--)
	{
		cin >> n;

		long long larger=n+1,less=n;
		while (!is_prime(larger)) larger++;
		while (!is_prime(less)) less--;

		long long num=2*less*larger,deno=less*larger-larger*2+2*(n-less+1);

		long long gcd=GCD(num,deno);
		num/=gcd;
		deno/=gcd;
		cout << deno << "/" << num << endl;
	}

	return 0;
}

bool is_prime(long long x)
{
	bool f=true;

	for (int i=0;i<prime.size();i++) if (x!=prime[i] && x % prime[i]==0) f=false;

	return f;
}

long long GCD(long long x,long long y)
{
	while (x%y!=0)
	{
		long long z=x%y;
		x=y;y=z;
	}
	return y;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
//#include <fstream>
using namespace std;
int t;
long long int x,u,v,q,p,g;
long long int gcd(long long int x,long long int y){
    if(y==0) return x;
    return gcd(y,x%y);
}
bool isPrime(long long int x){
    int k=sqrt(x);
    for(int i=2;i<=k;i++){
        if(x%i==0) return false;
    }
    return true;
}
int main(){
    //ifstream cin("in.txt");
    cin>>t;
    for(int a=0;a<t;a++){
        cin>>x;
        v=x;
        u=x+1;
        while(!isPrime(v)) v--;
        while(!isPrime(u)) u++;
        p=(u*(v-2))+(2*(x-v+1));
        q=2*u*v;
        g=gcd(p,q);
        p/=g;
        q/=g;
        cout<<p<<"/"<<q<<endl;
    }
return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <string>
#include <numeric>
#include <functional>
#include <iterator>
#include <typeinfo>
#include <utility>
#include <memory>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstddef>
#include <complex>
#include <ctime>
#include <cassert>
using namespace std;

typedef long long int64;
const int inf = 2000000000;
static inline int Rint()
{
	struct X{ int dig[256]; X(){
	for(int i = '0'; i <= '9'; ++i) dig[i] = 1; dig['-'] = 1;
	}};
	static 	X fuck;int s = 1, v = 0, c;
	for (;!fuck.dig[c = getchar()];);
	if (c == '-') s = 0; else if (fuck.dig[c]) v = c ^ 48;
	for (;fuck.dig[c = getchar()]; v = v * 10 + (c ^ 48));
	return s ? v : -v;
}
typedef vector<int> vi;
typedef vi::iterator ivi;
typedef map<int, int> mii;
typedef mii::iterator imii;
typedef set<int> si;
typedef si::iterator isi;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define rep(i, s, e) for (int i = (s); i < (e); ++i)
#define foreach(itr, c) for(__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); ++itr)
template<typename T> static inline void cmax(T& a, const T& b){if(b>a)a=b;}
template<typename T> static inline void cmin(T& a, const T& b){if(b<a)a=b;}

const int maxp = 1000005;
static int plist[maxp/3], pmask[maxp+1], pcnt;
static inline int is_prime(int64 n)
{
    if (n <= 1) return 0;
    if (n <= maxp) return pmask[n] == n;
    for (int i = 0; i < pcnt; ++i)
    {
        const int64 p = plist[i];
        const int64 test = p * p;
        if (test > n) break;
        if (n % p == 0) return 0;
    }
    return 1;
}
static inline void init_primes()
{
    for (int i = 1; i <= maxp; ++i) pmask[i] = i;
    for (int i = 2; i <= maxp; ++i)
    {
        if (pmask[i] == i)
        {
            plist[pcnt++] = i;
        }
        for (int j = 0; j < pcnt; ++j)
        {
            const int64 t = (int64)plist[j] * i;
            if (t > maxp) break;
            pmask[t] = plist[j];
            if (i % plist[j] == 0)
            {
                break;
            }
        }
    }
}

int main()
{
	init_primes();

	int cases = Rint();
	while (cases--)
	{
		int64 n = Rint();
		int64 u = n, v = n + 1;
		while (!is_prime(u)) --u;
		while (!is_prime(v)) ++v;
		int64 p = u * v - 2 * u - 2 * (v-1-n);
		int64 q = 2 * u * v;
		int64 d = __gcd(p, q);
		p /= d, q /= d;
		printf("%I64d/%I64d\n", p, q);
	}
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;

int isprime(int n)
{
	for(int i=2; i*i<=n; i++){
		if(!(n%i))
			return false;
	}
	return true;
}

int find1(int n)
{
	for(; n>=2; n--){
		if(isprime(n))
			return n;
	}
}

int find2(int n)
{
	for(n++; ;n++){
		if(isprime(n))
			return n;
	}
}

long long gcd(long long a,long long b)
{
	if(a < b)
	    swap(a, b);
    long long tmp = a % b;
    while(tmp)
    {
         a=b;
         b=tmp;
         tmp = a % b;
    }
    return b;
}

int main ()
{
	int T, n;
	scanf("%d", &T);
	while(T--){
		scanf("%d", &n);
		long long v=find1(n);
		long long u=find2(n);
		long long a=u*(v-2)+2*(n-v+1);
		long long b=2*u*v;
		long long t=gcd(a,b);
		printf("%I64d/%I64d\n", a/t, b/t);
	}
	return 0;
}


#include<stdio.h>

int isprime(int n)
{
	for(int i=2; i*i<n; i++){
		if(!(n%i))
			return false;
	}
	return true;
}

int find1(int n)
{
	for(; n>=2; n--){
		if(isprime(n))
			return n;
	}
}

int find2(int n)
{
	for(n++; ;n++){
		if(isprime(n))
			return n;
	}
}

long long gcd(long long a,long long b)
{
    int r;
    while(b>0)
    {
         r=a%b;
         a=b;
         b=r;
    }
    return a;
}

int main ()
{
	int T, n;
	scanf("%d", &T);
	while(T--){
		scanf("%d", &n);
		long long v=find1(n);
		long long u=find2(n);
		long long a=u*(v-2)+2*(n-v+1);
		long long b=2*u*v;
		long long t=gcd(a,b);
		printf("%I64d/%I64d\n", a/t, b/t);
	}
	return 0;
}


#include <cstdio>

inline long long mult(long long x, long long y, long long n) {
    long long tmp = x;
    tmp *= y;
    tmp %= n;
    return (long long)tmp;
}

long long gcd(long long a, long long b) {
    if(b == 0) return a;
    else if(a % b == 0) return b;
    else return gcd(b, a % b);
}

inline long long Abs(long long x) {
    return x < 0 ? -x : x;
}

long long exp(long long a, long long n, long long p) {
    if(p == 0) return 1;
    long long x = exp(a, n, p >> 1);
    x = mult(x, x, n);

    if(p & 1) x = mult(x, a, n);
    return x;
}

inline bool withness(long long s, long long n) {
    long long t = n - 1;
    int cnt = 0;
    while(!(t & 1)) {
        cnt++;
        t /= 2;
    }
    long long x = exp(s, n, t);
    long long pre = x;
    for(int i = 0; i < cnt; i++) {
        x = mult(x, x, n);

        if(x == 1 && pre != 1 && pre != n - 1) return true;

        pre = x;
    }

    if(x != 1) return true;

    return false;
}

inline bool is_prime(long long n) {
    for(int i = 2; i < 44; i++) {
        int flag ;
        long long tmp = i % n;
        if(i % n == 0) continue;
        flag = withness(tmp, n);
        if(flag) return false;
    }
    return true;
}

int main() {
    int t;
    scanf("%d", &t);
    while(t--) {
        long long n;
        scanf("%lld", &n);
        if(n == 2) {
            printf("1/6\n");
            continue;
        }
        long long x = n, y = n;
        for(long long i = n; i >= n - 10000; i--) {
            if(is_prime(i)) {
                x = i;
                break;
            }
        }
        for(long long i = n + 1; i <= n + 10000; i++) {
            if(is_prime(i)) {
                y = i;
                break;
            }
        }
        if(n == y - 1) {
            printf("%lld/%lld\n", y - 2, 2 * y);
            continue;
        }
        long long p = (y - 2) * x - (y - 1 - n) * 2;
        long long q = 2 * x * y;
        long long tmp = gcd(p, q);
        printf("%lld/%lld\n", p / tmp, q / tmp);
    }
    return 0;
}


#include <cstdio>

inline long long mult(long long x, long long y, long long n) {
    __int128 tmp = x;
    tmp *= y;
    tmp %= n;
    return (long long)tmp;
}

long long gcd(long long a, long long b) {
    if(b == 0) return a;
    else if(a % b == 0) return b;
    else return gcd(b, a % b);
}

inline long long Abs(long long x) {
    return x < 0 ? -x : x;
}

long long exp(long long a, long long n, long long p) {
    if(p == 0) return 1;
    long long x = exp(a, n, p >> 1);
    x = mult(x, x, n);

    if(p & 1) x = mult(x, a, n);
    return x;
}

inline bool withness(long long s, long long n) {
    long long t = n - 1;
    int cnt = 0;
    while(!(t & 1)) {
        cnt++;
        t /= 2;
    }
    long long x = exp(s, n, t);
    long long pre = x;
    for(int i = 0; i < cnt; i++) {
        x = mult(x, x, n);

        if(x == 1 && pre != 1 && pre != n - 1) return true;

        pre = x;
    }

    if(x != 1) return true;

    return false;
}

inline bool is_prime(long long n) {
    for(int i = 2; i < 44; i++) {
        int flag ;
        long long tmp = i % n;
        if(i % n == 0) continue;
        flag = withness(tmp, n);
        if(flag) return false;
    }
    return true;
}

int main() {
    int t;
    scanf("%d", &t);
    while(t--) {
        long long n;
        scanf("%lld", &n);
        if(n == 2) {
            printf("1/6\n");
            continue;
        }
        long long x = n, y = n;
        for(long long i = n; i >= n - 10000; i--) {
            if(is_prime(i)) {
                x = i;
                break;
            }
        }
        for(long long i = n + 1; i <= n + 10000; i++) {
            if(is_prime(i)) {
                y = i;
                break;
            }
        }
        if(n == y - 1) {
            printf("%lld/%lld\n", y - 2, 2 * y);
            continue;
        }
        long long p = (y - 2) * x - (y - 1 - n) * 2;
        long long q = 2 * x * y;
        long long tmp = gcd(p, q);
        printf("%lld/%lld\n", p / tmp, q / tmp);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MOD = 1e9+7;
const auto INF  = 0x3f3f3f3f;
const int N = 1e6+5;
int prime[N];
vector<int> isprime;
void getprime() {
    for(int i=2; i<=N-5; i++) {
        if(!prime[i]) {
            isprime.push_back(i);
            for(int j=2*i; j<=N-5; j+=i) {
                prime[j] = true;
            }
        }
    }
}

LL GCD(LL a, LL b) {
    if(!b)
        return a;
    return GCD(b, a%b);
}

const int S=20;//随机算法判定次数，S越大，判错概率越小
long long mult_mod(long long a,long long b,long long c)
{
    a%=c;
    b%=c;
    long long ret=0;
    while(b)
    {
        if(b&1){ret+=a;ret%=c;}
        a<<=1;
        if(a>=c)a%=c;
        b>>=1;
    }
    return ret;
}
long long pow_mod(long long x,long long n,long long mod)//x^n%c
{
    if(n==1)return x%mod;
    x%=mod;
    long long tmp=x;
    long long ret=1;
    while(n)
    {
        if(n&1) ret=mult_mod(ret,tmp,mod);
        tmp=mult_mod(tmp,tmp,mod);
        n>>=1;
    }
    return ret;
}

bool check(long long a,long long n,long long x,long long t)
{
    long long ret=pow_mod(a,x,n);
    long long last=ret;
    for(int i=1;i<=t;i++)
    {
        ret=mult_mod(ret,ret,n);
        if(ret==1&&last!=1&&last!=n-1) return true;//合数
        last=ret;
    }
    if(ret!=1) return true;
    return false;
}

bool Miller_Rabin(long long n)
{
    if(n<2)return false;
    if(n==2)return true;
    if((n&1)==0) return false;
    long long x=n-1;
    long long t=0;
    while((x&1)==0){x>>=1;t++;}
    for(int i=0;i<S;i++)
    {
        long long a=rand()%(n-1)+1;
        if(check(a,n,x,t))
            return false;
    }
    return true;
}

int main() {
    getprime();
    int T;
    scanf("%d", &T);
    while(T--) {
        int n;
        scanf("%d", &n);
        LL ans1, ans2, a, b;
        for(int i = n+1; ;i++) {
            if(Miller_Rabin(i)) {
                b = i;
                break;
            }
        }
        for(int i=n; ; i--) {
            if(Miller_Rabin(i)) {
                a = i;
                break;
            }
        }
  //      printf("a=%lld b=%lld %lld\n", a, b, a*b);
        LL temp = a*b;
        a = a+(b-n-1);
        b = temp;
        ans1 = b-2*a;
        ans2 = 2*b;
  //      printf("a=%lld b=%lld ans1=%lld ans2=%lld\n", a, b,ans1, ans2);
        LL gcd = GCD(ans1, ans2);
        ans1 /= gcd;
        ans2 /= gcd;
        printf("%lld/%lld\n", ans1, ans2);
    }
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MOD = 1e9+7;
const auto INF  = 0x3f3f3f3f;
const int N = 1e6+5;
int prime[N];
vector<int> isprime;
void getprime() {
    for(int i=2; i<=N-5; i++) {
        if(!prime[i]) {
            isprime.push_back(i);
            for(int j=2*i; j<=N-5; j+=i) {
                prime[j] = true;
            }
        }
    }
}

LL GCD(LL a, LL b) {
    if(!b)
        return a;
    return GCD(b, a%b);
}

bool ok(int x) {
    int m = sqrt(x);
    for(int i=2; i<=m; i++) {
        if(x % i == 0)
            return false;
    }
    return true;
}

int main() {
    getprime();
    int T;
    scanf("%d", &T);
    while(T--) {
        int n;
        scanf("%d", &n);
        LL ans1, ans2, a, b;
        for(int i = n+1; ;i++) {
            if(ok(i)) {
                b = i;
                break;
            }
        }
        for(int i=n; ; i--) {
            if(ok(i)) {
                a = i;
                break;
            }
        }
  //      printf("a=%lld b=%lld %lld\n", a, b, a*b);
        LL temp = a*b;
        a = a+(b-n-1);
        b = temp;
        ans1 = b-2*a;
        ans2 = 2*b;
  //      printf("a=%lld b=%lld ans1=%lld ans2=%lld\n", a, b,ans1, ans2);
        LL gcd = GCD(ans1, ans2);
        ans1 /= gcd;
        ans2 /= gcd;
        printf("%lld/%lld\n", ans1, ans2);
    }
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MOD = 1e9+7;
const auto INF  = 0x3f3f3f3f;
const int N = 1e6+5;
int prime[N];
vector<int> isprime;
void getprime() {
    for(int i=2; i<=N-5; i++) {
        if(!prime[i]) {
            isprime.push_back(i);
            for(int j=2*i; j<=N-5; j+=i) {
                prime[j] = true;
            }
        }
    }
}

LL GCD(LL a, LL b) {
    if(!b)
        return a;
    return GCD(b, a%b);
}

const int S=20;//随机算法判定次数，S越大，判错概率越小
long long mult_mod(long long a,long long b,long long c)
{
    a%=c;
    b%=c;
    long long ret=0;
    while(b)
    {
        if(b&1){ret+=a;ret%=c;}
        a<<=1;
        if(a>=c)a%=c;
        b>>=1;
    }
    return ret;
}
long long pow_mod(long long x,long long n,long long mod)//x^n%c
{
    if(n==1)return x%mod;
    x%=mod;
    long long tmp=x;
    long long ret=1;
    while(n)
    {
        if(n&1) ret=mult_mod(ret,tmp,mod);
        tmp=mult_mod(tmp,tmp,mod);
        n>>=1;
    }
    return ret;
}

bool check(long long a,long long n,long long x,long long t)
{
    long long ret=pow_mod(a,x,n);
    long long last=ret;
    for(int i=1;i<=t;i++)
    {
        ret=mult_mod(ret,ret,n);
        if(ret==1&&last!=1&&last!=n-1) return true;//合数
        last=ret;
    }
    if(ret!=1) return true;
    return false;
}

bool Miller_Rabin(long long n)
{
    if(n<2)return false;
    if(n==2)return true;
    if((n&1)==0) return false;
    long long x=n-1;
    long long t=0;
    while((x&1)==0){x>>=1;t++;}
    for(int i=0;i<S;i++)
    {
        long long a=rand()%(n-1)+1;
        if(check(a,n,x,t))
            return false;
    }
    return true;
}

int main() {
    getprime();
    int T;
    scanf("%d", &T);
    while(T--) {
        int n;
        scanf("%d", &n);
        LL ans1, ans2, a, b;
        for(int i = n+1; ;i++) {
            if(Miller_Rabin(i)) {
                b = i;
                break;
            }
        }
        for(int i=n; ; i--) {
            if(Miller_Rabin(i)) {
                a = i;
                break;
            }
        }
        ans1 = b-2;
        ans2 = 2*b;
        LL temp = a;
        a = b-n-1;
        b = temp*b;
        temp = b * ans2;
        ans1 = ans1 * b - a*ans2;
        ans2 = temp;
        LL gcd = GCD(ans1, ans2);
        ans1 /= gcd;
        ans2 /= gcd;
        printf("%lld/%lld\n", ans1, ans2);
    }
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MOD = 1e9+7;
const auto INF  = 0x3f3f3f3f;
const int N = 1e6+5;
int prime[N];
vector<int> isprime;
void getprime() {
    for(int i=2; i<=N-5; i++) {
        if(!prime[i]) {
            isprime.push_back(i);
            for(int j=2*i; j<=N-5; j+=i) {
                prime[j] = true;
            }
        }
    }
}

LL GCD(LL a, LL b) {
    if(!b)
        return a;
    return GCD(b, a%b);
}

int main() {
    getprime();
    int T;
    scanf("%d", &T);
    while(T--) {
        int n;
        scanf("%d", &n);
        LL ans1, ans2;
        ans2 = 1;
        ans1 = 0;
        for(int i=0; i<(int)isprime.size(); i++) {
            int x = isprime[i];
            if(x > n)
                break;
            LL a1, a2;
            a1 = min(isprime[i+1]-x, n-x+1);
            a2 = x*isprime[i+1];
            LL a3 = a2*ans2;
            a1 = a1*ans2 + ans1*a2;
            LL gcd = GCD(a1, a3);
            ans1 = a1/gcd;
            ans2 = a3/gcd;
        }
        printf("%lld/%lld\n", ans1, ans2);
    }
}


#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#include <functional>
#if __cplusplus > 199711L
#include <unordered_set>
#include <unordered_map>
#include <tuple>
#endif

using namespace std;

#define mp make_pair
#define pb push_back
#define sqr(x) ((x) * (x))
#define sz(x) (int)(x.size())
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
            freopen("output.txt", "w", stdout);

typedef long long ll;
typedef vector <int> vi;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const int maxn = (int)2e4;
const double eps = 1e-9;
const double pi = acos(-1.0);

bool isPrime(int x) {
    if (x < 2) {
        return false;
    }

    for (int i = 2; i <= sqrt(x); i++) {
        if (x % i == 0) {
            return false;
        }
    }

    return true;
}

int main() { // frp
    int T;
    scanf("%d", &T);

    while (T--) {
        int n;
        scanf("%d", &n);

        long long p = n;
        while (!isPrime(p)) {
            p--;
        }

        long long q = n + 1;
        while (!isPrime(q)) {
            q++;
        }

        long long num = p * q - 2 * q + 2 * (n - p + 1);
        long long den = 2 * p * q;
        long long g = __gcd(num, den);

        printf("%lld/%lld\n", num / g, den / g);
    }

    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }

bool is_prime(long long x) {
    if (x <= 1) return false;
    for (long long i = 2; i * i <= x; i++) if (x % i == 0) return false;
    return true;
}

int main() {
    int T; cin >> T;
    while (T--) {
        int n; cin >> n;
        long long v = n, u = n + 1;
        while (!is_prime(v)) v--;
        while (!is_prime(u)) u++;
        long long num = (v - 2) * u + 2 * (n - v + 1);
        long long den = 2 * v * u;
        long long g = gcd(num, den);
        cout << num / g << "/" << den / g << endl;
    }
    return 0;
}


#include <cstdio>

typedef long long ll;

bool is_prime(ll x) {
	if(x<2) return false;

	for(ll i=2;i*i<=x;i++) {
		if(x%i==0) return false;
	}

	return true;
}

ll gcd(ll a, ll b){
	return a==0 ? b : gcd(b%a, a);
}

int main() {
	int t;
	scanf("%d", &t);
	ll n;
	while(t--) {
		scanf("%lld", &n);

		ll L = n, R = n+1;
		while(!is_prime(L)) L--;
		while(!is_prime(R)) R++;

		// 1/2 - 1/L + (n-L+1)/(L*R)
		ll num = L*R - 2*R + 2*(n-L+1);
		ll den = 2*L*R;
		ll G = gcd(num, den);
		// printf("%lld %lld\n", L, R);
		printf("%lld/%lld\n", num/G, den/G);
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<iterator>
#include<stack>
#include<queue>
#include<utility>
#include<functional>
#include<bitset>
#include<numeric>
#include<cstring>
#include<tuple>
using namespace std;

int t;
long long n, a = 2, d, x, num, den;

bool prime( int n )
{
	if( n <= 1 )
	{
		return false;
	}
	for( int i = 2; i * i <= n; ++i )
	{
		if( n % i == 0 )
		{
			return false;
		}
	}
	return true;
}

long long pre( void )
{
	for( int i = n; ; --i )
	{
		if( prime( i ) )
		{
			return i;
		}
	}
}

long long nxt( void )
{
	for( int i = n + 1; ; ++i )
	{
		if( prime( i ) )
		{
			return i;
		}
	}
}

int main( void )
{
	ios :: sync_with_stdio( 0 );
	cin.tie( 0 );

	cin >> t;
	for( int z = 1; z <= t; ++z )
	{
		cin >> n;
		d = pre();
		x = nxt();
		num = d * x - a * x + a * ( n - d + 1 );
		den = a * d * x;
		d = __gcd( num, den );
		cout << num / d << "/" << den / d << "\n";
	}
	return 0;
}


//Prashant Tyagi
using namespace std;
#include <bits/stdc++.h>
#define TRACE
#ifdef TRACE
#define TR(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define TR(...)
#endif
typedef  long long                     LL;
typedef  vector < int >                VI;
typedef  pair< int, int >              II;
typedef  vector < II >                 VII;
#define SI(x)                          scanf ("%d", &x)
#define SLL(x)                         scanf ("%lld", &x)
#define PI(x)                          printf ("%d\n", x)
#define PLL(x)                         printf ("%lld\n", x)
#define MOD                            98765431
#define PB                             push_back
#define MP                             make_pair
#define ALL(v)                         v.begin(), v.end()
#define VIF(x,V)                       for(int x:V)
#define FILL(a,b)                      memset(a,b,sizeof(a))
#define REP(i,j,n)                     for(int i=j;i<n;i++)
#define FLD(i,j,n)                     for(int i=n-1;i>=j;i--)
#define F                              first
#define S                              second
#define fast_io                        ios_base::sync_with_stdio(false);cin.tie(NULL)

bool check_prime(int x)
{
	for (int i=2;i*i<=x;i++){
		if(x%i==0)return false;
	}
	return true;
}

int find_nxt_prime(int x)
{
	for(int i=x+1;;i++){
		if(check_prime(i))return i;
	}
}

int less_than_equal_prime(int x)
{
	for(int i=x;;i--){
		if(check_prime(i))return i;
	}
}

void print_irreducible(LL a,LL b)
{
	LL gd=__gcd(a,b);
	a=a/gd;
	b=b/gd;
	cout<<a<<"/"<<b<<endl;
}
int main ()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int T;SI(T);
	while(T--){
		int n;SI(n);
		if(n==2){
			cout<<1<<"/"<<6<<endl;
			continue;
		}else if(n==3){
			cout<<7<<"/"<<30<<endl;
			continue;
		}
		if(check_prime(n)){
			int nxt_prime=find_nxt_prime(n);
			print_irreducible(n*1ll*nxt_prime-2*1ll*nxt_prime+(LL)2,2*n*1ll*nxt_prime);
		}else {
			int pre_prime=less_than_equal_prime(n);
			int nxt_prime=find_nxt_prime(n);
			print_irreducible(pre_prime*1ll*nxt_prime-2*1ll*nxt_prime+2*1ll*(n+1-pre_prime),2*nxt_prime*1ll*pre_prime);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long int
const int mod = 1000000007;

int isprime(int n){for(int i=2;i*i<=n;i++){if(n%i==0)return 0;}return 1;}

signed main()
{
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    int t=1; cin>>t; while(t--)
    {
    	int n;
    	cin>>n;

    	int x=n+1,y=n+1;
        while(!isprime(x))
            x--;
        while(!isprime(y))
            y++;

        int num = x*y-2*y+2*(n-x+1);
        int deno = 2*x*y;
        int g = __gcd(num,deno);

        cout<<num/g<<"/"<<deno/g<<endl;

    }

    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

bool Pier(ll n)
{
    if (n <= 1)
        return false;
    for (int i = 2; i * i <= n; ++i)
        if (n % i == 0)
            return false;
    return true;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        ll n;
        cin >> n;
        ll pop = n;
        while (!Pier(pop))
            --pop;
        int nast = n + 1;
        while (!Pier(nast))
            ++nast;
        ll l = pop * nast - 2 * nast + 2 * n - 2 * pop + 2;
        ll m = 2 * pop * nast;
        ll nwd = __gcd(l, m);
        cout << l / nwd << "/" << m / nwd << endl;
    }
    return 0;
}