ODWS - One day with string
Rafa always interested in string problem and playing with string when feel bored. One day he is trying to write all the string which is lexicographically larger than string s and lexicographically smaller than string t and the length of the strings are same as the length of s and t. The string s and t consist of lowercase English letters of same length. After a few moment he got tired and thinking to solve it with computer. As he is so tired he want you to write a program to find how many string exist for the given constrains.
Input
Input starts with the number of test cases T (T<=100). Each input contains two lines, the first line contains string s (1 ≤ |s| ≤ 100), consisting of lowercase English letters. Here, |s| denotes the length of the string.
The second line contains string t (|t| = |s|), consisting of lowercase English letters.
It is guaranteed that the lengths of strings s and t are the same and string s is lexicographically less than string t.
Output
Print the case number and the result. Since the result may be large you should print the result modulo 1,000,000,007. For better understand check the input and output given below.
Example
Input: 3
a
d
abcdefg
abcdefh
xy
yz Output: Case 1: 2
Case 2: 0
Case 3: 26
Problem Setter:
Md. Istiyak ahmed
Daffodil International University, Dhaka
hide comments
Siddharth Singh:
2016-07-16 11:59:28
Modular Exponential lead to 4 WA's
|
|
Bharat Choudary:
2015-07-06 17:08:58
good problem...
|
|
vipul:
2015-06-12 00:13:45
done feeling very confident Last edit: 2015-06-12 20:15:37 |
|
rbshadow:
2015-04-16 21:44:58
Creative problem....Really good. |
|
LUCIFER:
2015-04-16 14:28:57
plz give some good test cases for checking wrong answer... |
|
darol:
2015-04-06 23:28:26
dont forget modulo part, costed me 2wa. |
|
Md.Mahmudul Hasan:
2015-04-04 11:31:41
very very nice problem
|
|
eightnoteight:
2015-04-04 10:53:53
oh Sorry! my mistake I think I haven't seen that line... but anyway nice problem.. |
|
shuvo karmakar:
2015-04-04 06:28:16
@eightnoteight
|
|
Harish Reddy Kolanu:
2015-04-04 05:12:24
Really good problem solved in 0.11 using java |
Added by: | shuvo karmakar |
Date: | 2015-04-03 |
Time limit: | 0.5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 JS-MONKEY |