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

Math Homework

Time Limit: 24000/12000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 128    Accepted Submission(s): 11


Problem Description
Alice has a lot of math homework to do today.
All the problems have the same form:
Please find out:

  However Alice is not interested at the homework at all. Can you write a program to help
her?(As the answer may be very large,you should only work out the ans mod 1000000007).
 

Input
The first line of the input contains an integer T which means the number of test cases. Then T lines follow, each line consists of six non-negative integers, a; b; c; n; k; k′.
a, b, c, n ≥ 0 and fit in 32-bit signed number
k + k′≤ 10
 

Output
For each case, you should output one line contains an integer, the answer to the problem.
 

Sample Input
1 2 0 1 3 1 1
 

Sample Output
10
 

Hint

We amuse that 0 ^ 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-11-23 08:26:14, Gzip enabled