upper_bound 时找的应该是 sumt2\dfrac{sum_t}{2}2sumt 而不是 n2\dfrac{n}{2}2n。
upper_bound
注意最后 check 时距离和最大值可达 5×10195\times10^{19}5×1019,注意开 unsigned long long。
check
unsigned long long