Secret Password
Practice
0 (0 votes)
Medium
Problem
4% Success 629 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Sarfaraz Forgot his laptop's password But Somehow he got a Binary String . And He know that after Adding All the Prime Numbers less than that Strings is the password . As the string is very big so he decided to do this by an algorithm. But in end he is unable to Crack the password. So he decided to take help of his friend Deepak. If Deepak is able to Crack the password then Sarfarz will Give him a treat Of a RiceBow.
Help Deepak in Cracking the Password

Constraints
1<='t'<=10^5
1<=(length of string)<=20
string(0,1)


Input:
First line contain a single integer 't' No. of test cases
next 't' line contains a String contains different pattern of 0's and 1's

Output
print 't' lines each total sum of Prime Numbers below that binary string

Sample Input
2
110
1111

Sample Output
10
41

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
1 votes
Points:30
Tags:
mediumDynamic programmingArrays2dIntroduction to Dynamic Programming-2AlgorithmsMediumDynamic Programming
Points:30
4 votes
Tags:
AlgorithmsIntroduction to Dynamic Programming-2Dynamic Programming
Editorial

No editorial available for this problem.