output_description: If we have x hours until New Year at M o'clock on 30th, December, print x.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      M
attempt: import math
  
  def isPrime(num):
      if num < 2:
          return False
      else:
          rootNum = math.floor(math.sqrt(num))
          for i in range(2,rootNum+1):
              if num % i == 0:
                  return False
      return True
  
  def solve():
      lst = []
      count = int(input())
      for i in range(count):
          ans = 0
          l, r = map(int, input().split())
          t = l
          while k <= r
              if isPrime(k) and isPrime((k+1)/2):
                  ans += 1
              k += 2
          lst.append(str(ans))
      print('\n'.join(lst))
  solve()
  
problem_description: Statement
  
  How many hours do we have until New Year at M o'clock (24-hour notation) on
  30th, December?
samples: [{"input": "21", "output": "27\n    \n\nWe have 27 hours until New Year at 21 o'clock on 30th, December.\n\n* * *"}, {"input": "12", "output": "36"}]