forked from anupam-kumar-krishnan/Competitive_Programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRings.cpp
More file actions
40 lines (39 loc) · 721 Bytes
/
Copy pathRings.cpp
File metadata and controls
40 lines (39 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
typedef long long ll;
using namespace std;
int main()
{
ll t;
cin>>t;
while(t--)
{
ll n,i,f=0,f1=0;
cin>>n;
string s;
cin>>s;
for( i=0;i<n;i++)
{
if(s[i]=='0'&&i>=n/2){
f=1;
break;
}
if(s[i]=='0'&&i<n/2)
{
f1=1;
break;
}
}
if(f==1)
{
cout<<1<<" "<<i+1<<" "<<1<<" "<<i<<endl;
}
if(f1==1)
{
cout<<i+2<<" "<<n<<" "<<i+1<<" "<<n<<endl;
}
if(f1==0&&f==0)
{
cout<<1<<" "<<n-1<<" "<<2<<" "<<n<<endl;
}
}
}