Sum of binary and decimal numbers Given an integer N Find the sum of all the numbers…
- User
Sum of binary and decimal numbers Given an integer N Find the sum of all the numbers from the range to N witho selecting any decimal numbers directly You are required to convert the decimal numbers into binary numbers and then add the same Note: Since the answer can be large, determine the required answer module 10° +7 Function description Complete the solve function provided in the editor. This function has the following parameter and retums the required sum modulo 1000000007 N: Represents the last number of range to N Input format for custom testing Note: Use this input format if you are testing against custom input or writing code in a language where we don't provide boilerplate code The first line contains T. which represents the number of test cases. For each test case: The first line contains an integer N Output format For each test case in a new line. print the sum from 1 to N Next Question> C++17 10.30) 1> #include<bits/stdc++- Long Long Solve (long long N) { // Write your code hersExplanation N-5 M-2 For the first query Take 24 subermy its XOR sian X450X wedge 1-5-(X-1) Semilany (2 2/3, 3442332 these subarrays also meet the given Condition Hence, the number of subarrays in rango 174 For the secund query •Talkiesubatray is XOR umso wedge-7+17) Similisty 23/44 these subterrays alle meet the given conditize Hence, the number of subarneys in the range (25/s3 Nate Your come must be able to print the sample cutput bum the provided sample inpύς However, your code is run egalist multiple hidden test cases. Therefore, your code must pass these hidden test cases to solve the problem statement Limits Time Limit, 10 secs for each input file Memory Limit 250 ма Sounve Limit: 1024 Scoring Scure is waigned if any testos p Allowed Languages Bash CCHC Clure, C, D. Fitang Fr. Go. Groovy Haskell, Java Java 14, amaberNude Julie Kotin, Lisp 15BCE), Lua. Objective-C. Cam Octare Pascal Pert PHF Python Python 3. Python 38 Racket, Ruby Rust Scale Swin, TypeSczak, Visual Back Pievious Question
- Assistant