| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 13191 | GEC1506-Ignore multiples (II) |
|
| 13192 | GEC1506-Ignore multiples and search |
|
Description
Given a boundary with numbers and several condition numbers,
generate a list of numbers within the given boundary, but without the multiples of condition numbers.
Input
The input consists of two lines as two parts with the following syntax:
0,20
3,5,7
- The first line is two boundary numbers which indicates the lower bound is 0 and the upper bound is 20.
- The second line is multiple constrained numbers which are 3, 5 and 7.
- All the numbers are integers.
With the input, you need to generate a list of integers within the boundary of 0 and 20. (20 is excluded!)
Note that the generated list MUST avoid all the multiples of the constrained numbers which are 3, 5 and 7 (e.x. 0, 3, 5, 6, 7, 9 ... should be avoided as they are the multiples of 3, 5 OR 7)
Output
The output is the generated list that formated with a "comma" between each element.
Note that the output list of numbers should be in ascending order.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Given a boundary with numbers, several condition numbers, and a target number, you need to
- Generate a list of numbers within the given boundary, but without the multiples of condition numbers.
- Print out positions that the target numbers are found.
Input
The input consists of 3 lines as 3 parts with the following syntax:
0,20
3,5,7
0,16
- The first two are the boundary numbers which indicates the lower bound is 0 and the upper bound is 20.
- The second line is the constrained numbers which are 3, 5, and 7.
- The last line are the target numbers to search.
- All the numbers are integers.
With the input, you need to generate a list of integers within the boundary of 0 and 20. (20 is excluded!)
Note that the generated list MUST avoid all the multiples of the constrained numbers which are 3, 5, and 7 (e.x. 0, 3, 5, 6, 7, 9 ... should be avoided as they are the multiples of 3, 5 OR 7)
Output
The outputs are:
- The generated list that formated with a "comma" between each element. (Note that the output list of numbers should be in ascending order.)
- The position of the target number found from the generated list. e.g. 0 is not found, so print out N/A; 16 is found at the 7th position.