report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Beautiful number - MarisaOJ: Marisa Online Judge

Beautiful number

Time limit: 1000 ms
Memory limit: 256 MB
A positive integer is considered beautiful if it is divisible by $3$, $5$, or $7$. If we arrange beautiful numbers in ascending order: $3, 5, 6, 7, 9, 10, 12, ...$, what is the $k$-th beautiful number? ### Input - A single line containing an integer $k$. ### Output - Print the $k$-th beautiful number. ### Constraints - $1 \le k \le 10^9$. ### Example Input: ``` 9 ``` Output: ``` 15 ```
Binary search on answer
Reading
Minimum maximum
Beautiful number
Multiplication table
k-th digit
Maximum mean
Birthday
Sorting the differences
Collecting
Topic
Math
Binary search
Rating 1000
Solution (1) Solution