Contest Problem A : The multiplication of multinomial
Time Limit: 1000 MS Memory Limit: 65536 K
Total Submit: 0 Accepted: 0
Description
Bob a pupil who is very studious . He is only seven years old, but he have studied multinomail all by himself.Today he is studying the multiplication of multionomial. He is so clever that he can calculate the answer quickly.But he don't know whehter the answer is right. So he need your help!
Input
The input contain multiply test case.First line is a integer number which is the number of test case, ans then two lines is following.Each line describe a multiomial. The first number of each is the length of the multinomial, and then is the coefficients of the multinomial. For example we can a multinomial (1 + x + x^2 + x^3)describe like this 4 1 1 1 1.
Output
For each case please output the cofficients of the answer.The coefficient which is equal to 0 isn't been output.If all cofficients is 0, output 0 please.Please output a blank between each cofficients.
Sample Input
2
3 1 1 1
3 2 3 4
3 -1 -1 -1
3 2 3 4
Sample Output
2 5 9 7 4
-2 -5 -9 -7 -4
Contest Problem B : A Easy Work
Time Limit: 1000 MS Memory Limit: 65536 K
Total Submit: 0 Accepted: 0
Description
Give a integer n, please find the permutation from 1~n.
Input
Each line of input contains a integer n which described above.
Output
For input print the permutation of 1~n with the lexicographically smallest.
Print a blank after each case.
Sample Input
3
4
Sample Output
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
1 2 3 4
1 2 4 3
1 3 2 4
1 3 4 2
1 4 2 3
1 4 3 2
2 1 3 4
2 1 4 3
2 3 1 4
2 3 4 1
2 4 1 3
2 4 3 1
3 1 2 4
3 1 4 2
3 2 1 4
3 2 4 1
3 4 1 2
3 4 2 1
4 1 2 3
4 1 3 2
4 2 1 3
4 2 3 1
4 3 1 2
4 3 2 1
Contest Problem C : Just need 8
Time Limit: 5000 MS Memory Limit: 65536 K
Total Submit: 0 Accepted: 0
Description
Many people like the number '8'.Do you love the number ‘8’? Many people make it their lucky number.And now many people think that the number which is the multiple of eight is also lucky too. Now give you a number N, could find the smallst N numbers which is the multiple of eight or the last digit is eight.
Input
Each line of inout contain a integer N described above.
Output
For each inout output N (0 < N <= 1000000)numbers described above.
Sample Input
3
Sample Output
8
16
18
Contest Problem D : Help me please!
Time Limit: 1000 MS Memory Limit: 65536 K
Total Submit: 0 Accepted: 0
Description
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several small pieces since that looks messy. This piece can be one whole pie though.
My friends are very annoying and if one of them gets a bigger piece than the others, they start complaining. Therefore all of them should get equally sized (but not necessarily equally shaped) pieces, even if this leads to some pie getting spoiled (which is better than spoiling the party). Of course, I want a piece of pie for myself too, and that piece should also be of the same size.
What is the largest possible piece size all of us can get? All the pies are cylindrical in shape and they all have the same height 1, but the radii of the pies can be different.
Input
One line with a positive integer: the number of test cases. Then for each test case:
One line with two integers N and F with 1 ≤ N, F ≤ 10 000: the number of pies and the number of friends.
One line with N integers ri with 1 ≤ ri ≤ 10 000: the radii of the pies.
Output
For each test case, output one line with the largest possible volume V such that me and my friends can all get a pie piece of size V. The answer should be given as a floating point number with four digits after the point.
Sample Input
3
3 3
4 3 3
1 24
5
10 5
1 4 2 3 4 5 6 5 4 2
Sample Output
25.1327
3.1416
50.2655
Contest Problem E : Barraucda's easy problem
Time Limit: 1000 MS Memory Limit: 65536 K
Total Submit: 0 Accepted: 0
Description
This is a easy problem Barraucda, but it's hard to fwish. help fwish, please ! 一个n*n棋盘上刻着一些数 ,现在从 左上角 出发前往 右下角,从出发点开始累加经过路线上每个点上的数,每条路径上不能有重复的点,求能到达 右下角,累加的最小的值。
Input
有多组数据, n = 0 代表文件结束。 每组数据第一行一个 n, 2 <= n <= 5 下面是 一个n*n 的棋盘, 棋盘上每个数 在 -1000 到 1000 之间 。
Output
每组数据包含一行, 输出最小值。
Sample Input
2
1 1
1 1
0
Sample Output
2
Contest Problem F : fwish's easy problem
Time Limit: 1000 MS Memory Limit: 65536 K
Total Submit: 0 Accepted: 0
Description
This is a easy problem Barraucda, but it's hard to fwish. help fwish, please ! 一个n*n棋盘上刻着一些数 ,现在从 左上角 出发前往 右下角,从出发点开始累加经过路线上每个点上的数,每条路径上不能有重复的点,求能到达 右下角,累加的最小的值。
Input
有多组数据, n = 0 代表文件结束。
每组数据第一行一个 n, 2 <= n <= 5
下面是 一个n*n 的棋盘, 棋盘上每个数 在 -1000 到 1000 之间 。
Output
每组数据包含一行, 输出最小值。
Sample Input
2
1 1
1 1
0
Sample Output
2
我全都帖出来了,随便做
[此贴子已经被作者于2007-4-22 22:23:53编辑过]