| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 10716 | Arithmetic Sequence |
|
| 10728 | A simple set problem |
|
| 11543 | number reverse and average |
|
Description
An arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms is a constant. For instance, the sequence 5, 7, 9, 11, 13, 15 … is an arithmetic sequence with common difference of 2.
Here, you are given an arithmetic sequence, where the initial term is ‘a’, the total number of terms in this sequence is ‘n’, and the common difference of successive terms is ‘d’. Then, in this sequence: what is the value of the nth term, and what is the sum of all the terms?
Input
Three integers separated by blanks. The first integer (a) is the initial term, where -1000<a<1000. The second integer (n) is the total number of terms in the sequence, where n>0 and n<1000. The third integer (d) is the common difference, where -1000<d<1000.
Output
Two values separated by a blank. The first value is the nth term of the sequence, and the second value is the sum of the sequence. Note that you do not need to print '\n' at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Out of the N NTHU 2015 Computer Science (CS) majors, X of them take the course CS13550* Introduction to Programming (I), Y of them take the course CL10100* College Chinese, and Z of them take none of the two courses (i.e., CS13550* and CL10100*). How many NTHU 2015 CS majors take both of the two courses? And how many take CS13550* but not CL10100*?
Input
Four integers N, X, Y, Z which are separated by blanks. Note that 0<N<1000, 0<X<1000, 0<Y<1000 and 0<Z<1000.
Output
Two integers separated by a blank. The first integer is the number of NTHU 2015 CS majors who take both CS13550* and CL10100*, and the second one is the number of NTHU 2015 CS majors who take CS13550* but not CL10100*. Note that you do not need to print '\n' at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
The input is a three-digit integer N that consists of digits 1-9 except 0. For example, 489 is such a number. The task is to reverse the order of the digits of N to get a new three-digit number M, and compute the average of the N and M. For example, if N is 489, then M is 984, and the answer should be 736.5.
Input
A three-digit integer consisting of 1-9 except 0
Output
The average of the input number and its reversal
The answer should be expressed as a floating point number with precision to the first decimal place. For example, 333.0 or 736.5
Note that you do not need to print ‘\n’ at the end of the output.