当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5720:Wool

题目描述
At dawn, Venus sets a second task for Psyche.

She is to cross a river and fetch golden wool from violent sheep who graze on the other side.

The sheep are wild and tameless, so Psyche keeps on throwing sticks to keep them away.

There are $ n $ sticks on the ground, the length of the $ i $-th stick is $ a_i $.

If the new stick she throws forms a triangle with any two sticks on the ground, the sheep will be irritated and attack her.

Psyche wants to throw a new stick whose length is within the interval $ [L, R] $. Help her calculate the number of valid sticks she can throw next time.
输入解释
The first line of input contains an integer $ T $ $ (1 \le T \le 10) $, which denotes the number of test cases.

For each test case, the first line of input contains single integer $ n, L, R $ $ (2 \le n \le 10 ^ 5, 1 \le L \le R \le 10 ^ {18}) $.

The second line contains $ n $ integers, the $ i $-th integer denotes $ a_i $ $ (1 \le a_i \le 10 ^ {18}) $.
输出解释
For each test case, print the number of ways to throw a stick.
输入样例
2
2 1 3
1 1
4 3 10
1 1 2 4
输出样例
2
5

提示
In the first example, $ 2, 3 $ are available.

In the second example, $ 6, 7, 8, 9, 10 $ are available.
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5720

最后修改于 2020-10-25T23:25:05+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
8000/4000MS(Java/Others) 262144/262144K(Java/Others)