-
Notifications
You must be signed in to change notification settings - Fork 0
/
A.cpp
47 lines (45 loc) · 867 Bytes
/
A.cpp
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
41
42
43
44
45
46
47
#include<bits/stdc++.h>
using namespace std;
#define fastio ios::sync_with_stdio(0);cin.tie(0)
int main()
{
fastio;
int t,a,b,i,p,f;
string s;
cin>>t;
while(t--)
{
p=0;
f=0;
cin>>s;
string x,y;
x.push_back(s[0]);
for(i=1;i<s.size();i++)
{
if(f==0)
{
if(s[i]!='0')
{
f=1;
y.push_back(s[i]);
}
else
x.push_back(s[i]);
}
else
y.push_back(s[i]);
}
if(y.size()==0)
{
cout<<-1<<"\n";
continue;
}
a=stoi(x);
b=stoi(y);
if(a<b)
cout<<a<<" "<<b<<"\n";
else
cout<<-1<<"\n";
}
return 0;
}