Type: RemoteJudge 1000ms 128MiB

魔法

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

cjwssb 知道是误会之后,跟你道了歉。你为了逗笑他,准备和他一起开始魔法。不过你的时间不多了,但是更惨的是你还需要完成 nn 个魔法任务。假设你当前的时间为 TT,每个任务需要有一定的限制 tit_i 表示只有当你的 TT 严格大于 tit_i 时你才能完成这个任务,完成任务并不需要消耗时间。当你完成第 ii 个任务时,你的时间 TT 会加上 bib_i,此时要保证 TT 在任何时刻都大于 00,那么请问你是否能完成这 nn 个魔法任务,如果可以,输出 +1s\texttt{+1}\texttt{s},如果不行,输出 -1s\texttt{-1}\texttt{s}

输入格式

第一行:一个整数 ZZ,表示有 ZZ 个测试点。

对于每个测试点:

第一行:两个整数 n,Tn,T,表示有 nn 个任务,你一开始有 TT 的时间。

接下来 nn 行,每行 22 个数字,tit_ibib_i

输出格式

对于每个测试点,输出 +1s\texttt{+1}\texttt{s} 或者 -1s\texttt{-1}\texttt{s}

1
2 13
1 -9
5 -3

+1s

提示

对于 20%20\% 的数据,n10n\leq10

对于 100%100\% 的数据,$n\leq10^5,Z\leq10,t_i\leq10^5,T\leq10^5,-10^5\leq b_i\leq 10^5$。

By lantian

LaTeX\LaTeX By ⚡炭治郎⚡

因为历史遗留问题,博客讨论可能无法发出样例输出的字符串,可以考虑使用其他方式规避。

天河AB23寒假联谊赛

Not Attended
Status
Done
Rule
IOI
Problem
5
Start at
2025-1-18 9:00
End at
2025-1-18 12:00
Duration
3 hour(s)
Host
Partic.
21