| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 10785 | Wave |
|
| 10786 | Progression |
|
| 10787 | Matrix scale |
|
Description
A character wave consistss of lines of characters, which has a parameter, length L. The number of characters in the first line is 1, and is increased by one in the every following lines. After the number of character reaches L, it starts to descrease until the number of characters become 1 again. For example, the following is a character wave of length 3.
#
##
###
##
#
Input
There are two items, separated by a space: the first one is a character C; the second one specifies the length L.
Output
Sample Input Download
Sample Output Download
Tags
Discuss
Description
The input contains three numbers, which are the 2nd, the 3rd and the 4th number of an arithmetic progression (等差數列) or a geometric progression (等比數列). Your task is to distinguish which progression it is from this numbers and print out the first number and the 5th number.
For example, if the input is 3 5 7, then you know this is an arithmetic progression and the common difference is 2. So the 1st and 5th number is 1 and 9 respectively.
There are NO progression like 1 1 1 or 2 2 2 which are both an arithmetic progression and a geometric progression.
Input
Three integers
Output
The 1st and the 5th number of the progression. The two numbers should be separated by a blank.
You DO NOT need to print ‘\n’ at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
There are some usefull manipulations on matrices like transposition, rotation, and etc. In this problem we want to scale a matrix by k times. For example, given a 2x2 matrix A[1 2 ; 3 4] and k=2, you need to expand the size of matrix A by repeating elements twice. So the output should be [1 1 2 2 ; 1 1 2 2 ; 3 3 4 4 ; 3 3 4 4]. Here is a illustration for you :
Input
The first line contains two integers, which are within the range of 1<=n<=1000 and 1<=k<=1000. The integer n represent the size of input matrix A and the number k denotes the scaling factor.
The next n lines each of which contains n integers, specifing the n-by-n input matrix A.
Output
The output should be a (k*n)-by-(k*n) matrix.
Each elements should be seperated be a space. You NEED to print '\n' at the end.