Multiplication Table
Time limit0.5sMemory limit1024 MB
Given N from 1 to 100, the task is to print 1 if N appears as a factor or product in the 2 to 9 multiplication tables, otherwise 0.
- Level
Easy1 of 10
- Topics
- Brute force, Implementation
- Solved
- No attempts yet
Problem
The multiplication table is made of entries in the form . The table for 2 is shown below, and the tables run from the 2 times table to the 9 times table.
Given a positive integer , determine whether the number appears in the multiplication table. counts as appearing if it equals any one of , , or .
Input
The first line contains a positive integer .
Output
If the given number appears in the multiplication table, print 1. Otherwise, print 0.