SP10640 MYQ2 - The Wild Wizard

Description

In the country of Thuvax lived an old wizard named Chanithpra. He practised a form of magic in which the power of spell came from the letters that were written on a piece of parchment. When a sentence s is written, the intensity of the letters are as follows: 1\. Intensity of 'a' is 1, 'b' is 2 and it continues till 'z' whose intensity is 26. 2\. Intensity of 'A' is 51, 'B' is 52 and it continues till 'Z' whose intensity is 76. 3\. Intensity of ' '(space) is 32. The power of a spell written as a part of the sentence is equal to the sum of the intensities of the characters present in it modulo m. Chanithpra finds an old parchment in Thuvax with a sentence s written on it. Help him find the longest spell (i, i+1, ... j) in the sentence s whose power matches with k. (0

Input Format

The first line contains a single positive integer t(1

Output Format

For each test case, output one line containing 2 integers. The first is the minimum index i(0