Input Format
The first line contains an integer, , the number of test cases. Each of the  subsequent lines contains a test case. A test case is described as  space-separated integers,  and , respectively.
  •  is the value to compare against.
  •  represents the range to compare:  to .
  • The number of template parameters passed to reversed_binary_value will be .
Output Format
Each line of output contains  binary characters (i.e., 's and 's). Each character represents one value in the range. The first character corresponds to the first value in the range. The last character corresponds to the last value in the range. The character is  if the value in the range matches ; otherwise, the character is .

hackerrank c++ variadics problem solution

C++ Variadics problem solution | HackerRank

template <bool... digits> struct ReversedBinaryValue;

template <>
struct ReversedBinaryValue<> {
    static constexpr int value = 0;

template <bool first,bool... digits>
struct ReversedBinaryValue<first,digits...> {
    static constexpr int value = first + 2*ReversedBinaryValue<digits...>::value;

template <bool...digits>
int reversed_binary_value()
    return ReversedBinaryValue<digits...>::value;