#P6210. 「SWTR-4」Easy Math Problems
「SWTR-4」Easy Math Problems
Description
Given , define the set and the set .
- Set contains all positive integers whose with is at most , and set contains the elements in that are not less than and not greater than .
Question 1: Find the -th smallest number in set .
Question 2: Find the number of elements in set .
Since the numbers are very large, Little A wants you to help compute the answers.
Input Format
A single line with five integers — with meanings as described in the statement.
Output Format
Output two lines of integers — the first line is the answer to Question 1, and the second line is the answer to Question 2.
12 3 8 10 17
11
6
72 5 66 13 89
94
54
360360 123 20200202 123456789 987654321
21751721
802555475
Hint
[Sample Explanation]
$S=\{1,2,3,5,7,9,10,11,13,14,15,17,\dots\},Q=\{10,11,13,14,15,17\}$. It can be seen that the -th smallest number in is , and the number of elements in is .
[Constraints and Notes]
This problem uses bundled tests.
Subtask : , , .
Subtask : , , .
Subtask : , , .
Subtask : , , .
For of the testdata, , , .
[Tips]
Want to solve this problem with ?
[Time Limit]
For the first subtasks, the time limit is , and for the remaining subtask it is .
[Source]
idea & std: Alex_Wei, verification: xtx1092515503 & FrenkiedeJong21 & chenxia25
Translated by ChatGPT 5
京公网安备 11011102002149号