Count the Products of Card Numbers
InterviewTime limit1sMemory limit512 MB
Given n, count the distinct products of n cards, each showing a digit from 1 to 9 with repetition allowed, where n is at most 7.
- Level
Easy3 of 10
- Topics
- Math, Brute force
- Solved
- No attempts yet
Problem
An infinite supply of cards is given, and each card has an integer from 1 to 9 written on it. Choose cards from them. You may choose the same card more than once. Let be the product of the integers on the chosen cards. Count how many distinct values can take.
Input
The first line contains the number of cards to choose.
Output
Print the number of distinct values that can take on the first line.