Lotto
Time limit1sMemory limit256 MB
Print 1 2 3 4 5 6, the lexicographically smallest increasing pick of six numbers from 1 to 45.
- Level
Easy1 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
A lotto ticket holds six distinct integers between 1 and 45. There are 8145060 ways to pick them, so this problem fixes exactly one of them as the answer.
To compare two picks, sort each of them in increasing order and compare the numbers one position at a time. At the first position where the two differ, the pick with the smaller number comes first in lexicographic order. Print the pick that comes first under this rule.
Input
There is no input.
Output
Print six distinct integers between 1 and 45 in increasing order on one line, separated by single spaces. Print the pick that is smallest in lexicographic order.