F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Random

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1660    Accepted Submission(s): 835


Problem Description
$N$ numbers, randomly generated between $ [0,1] $

Make $M$ operation, $\frac {1} {2} $ probability to delete the maximum value, $ \frac {1} {2} $ probability to delete the minimum value

Calculate the sum of expected value module $10^9+7 $
 

Input
Each test contains multiple test cases. The first line contains the number of test cases $T$($1\le T \le 10000$). Description of the test cases follows.

The first line of each test case contains two integers $n,m$

$1\le m \le n \le 10^9$
 

Output
For each test case, print one integer — the answer to the problem.
 

Sample Input
2 2 2 3 1
 

Sample Output
0 1
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-11 00:48:24, Gzip enabled