Rasta and Tavas
Practice
2.7 (46 votes)
Brute Force search
Open
Easy
Mathamatics
Problem
80% Success 3710 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code
Rasta calls a number like a Tavas if and only if 1 ≤ a ≤ n and the sum of all primes (like p) that p | a is exactly equal to k.
He asks you to find the number of Tavases.
Input format
The first and only line of input contains two integers, n and k (1 ≤ n, k ≤ 106).
Output format
Print a single integer, the number of Tavases.
Submissions
Please login to view your submissions
Similar Problems
Points:20
26 votes
Tags:
Data StructuresBasic MathAlgorithmsMath BasicMath
Points:20
4 votes
Tags:
Easy
Points:20
979 votes
Tags:
Ad-HocEasyReadyMathematicsOpenApproved
Editorial