report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Math - FlandreOJ: Flandre Online Judge

Math

Time limit: 1000 ms
Memory limit: 256 MB
Let $f(x)$ be the sum of the digits in the integer $x$. Given an integer $k$, find the smallest $f(x)$ such that $x$ is a positive integer divisible by $k$. ### Input - A single line contains an integer $k$. ### Output - Print the smallest $f(x)$. ### Constraints - $2 \le k \le 10^5$. ### Example Input: ``` 6 ``` Output: ``` 3 ``` #### Note: Choose $x=12$.
Shortest path
Shortest path
Delete edge
3D path
Number of shortest paths
Double edge
Second shortest path
Bye bye maximum edge
Boardgame
Teleport
?
Math
Festival 3
Arbitrage
Festival 4
String construction
Bye bye maximum edge 2
Elevator
Holiday
Fortress defense
Topic
Math
Graph
Shortest path
Rating 1700
Source Free Contest
Solution (1) Solution