100% Guaranteed Results


Project
$ 15.99
Category:

Description

5/5 – (1 vote)

This problem is a programming version of Problem 36 from projecteuler.net
The decimal number, 585=10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than N, which are palindromic in base 10 and base K.
Input Format
Input contains two integers N and K.
Output Format
Print the answer corresponding to the test case.
Constraints
10≤N≤106
2≤K≤9
Sample Input

Sample Output

Reviews

There are no reviews yet.

Be the first to review “Project”

Your email address will not be published. Required fields are marked *

Related products