#CF2009E. Klee's SUPER DUPER LARGE Array!!!
Klee's SUPER DUPER LARGE Array!!!
题目描述
题目大意
你将得到一个长度为 的序列 ,请求出 的值,其中
$$S=\min\limits_{1\le x\le n}|(\sum\limits_{i=1}^x a_i)-(\sum\limits_{i=x+1}^n a_i)|$$输入格式
本题存在多组测试数据。第一行为一个正整数 (),表示数据组数。对于每组数据分别给出用空格隔开的两个整数 与 ()。
输出格式
对于每组数据,输出一行一个整数 。
样例
4
2 2
7 2
5 3
1000000000 1000000000
1
5
1
347369930
样例说明
In the first sample, . When is chosen, . It can be shown this is the minimum possible value of .
In the third sample, . When is chosen, . It can be shown this is the minimum possible value of .
来源
Codeforces 2009E,英文题名 Klee's SUPER DUPER LARGE Array!!!。