欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1913A.Rating Increase
Rating Increase
Monocarp is a great solver of adhoc problems. Recently, he participated in an Educational Codeforces Round, and gained rating!
Monocarp knew that, before the round, his rating was . After the round, it increased to (). He wrote both values one after another to not forget them.
However, he wrote them so close to each other, that he can't tell now where the first value ends and the second value starts.
Please, help him find some values and such that:
- neither of them has a leading zero;
- both of them are strictly greater than ;
- ;
- they produce the given value when written one after another.
If there are multiple answers, you can print any of them.
Input
The first line contains a single integer () — the number of testcases.
The only line of each testcase consists of a single string of length from to that:
- consists only of digits;
- doesn't start with a zero.
Output
For each testcase, determine if such values and exist. If they don't, print -1. Otherwise, print two integers and .
If there are multiple answers, you can print any of them.
Note
In the second testcase, printing and is also valid.
In the third testcase, and is not valid, because has a leading zero. and is not valid, because is not strictly greater than .
Samples
5
20002001
391125
200200
2001000
12
2000 2001
39 1125
-1
200 1000
1 2
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |