

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
直線上に 個の点 がこの順に並んでいます。(下の図も参考にしてください)
隣り合う点の距離は次の通りです。
- 点 と点 の距離は
- 点 と点 の距離は
- 点 と点 の距離は
- 点 と点 の距離は
- 点 と点 の距離は
- 点 と点 の距離は
2 つの英大文字 が与えられます。 は A
,B
,C
,D
,E
,F
,G
のいずれかで、 が成り立ちます。
点 と点 の間の距離を答えてください。
制約
- は
A
,B
,C
,D
,E
,F
,G
のいずれか
入力
入力は以下の形式で標準入力から与えられる。
出力
点 と点 の間の距離を出力せよ。
入力例 1Copy
A C
出力例 1Copy
4
点 と点 の距離は です。
入力例 2Copy
G B
出力例 2Copy
20
点 と点 の距離は です。
入力例 3Copy
C F
出力例 3Copy
10
Score : points
Problem Statement
There are points , , , , , , and on a straight line, in this order. (See also the figure below.)
The distances between adjacent points are as follows.
- Between and :
- Between and :
- Between and :
- Between and :
- Between and :
- Between and :
You are given two uppercase English letters and . Each of and is A
, B
, C
, D
, E
, F
, or G
, and it holds that .
Find the distance between the points and .
Constraints
- Each of and is
A
,B
,C
,D
,E
,F
, orG
.
Input
The input is given from Standard Input in the following format:
Output
Print the distance between the points and .
Sample Input 1Copy
A C
Sample Output 1Copy
4
The distance between the points and is .
Sample Input 2Copy
G B
Sample Output 2Copy
20
The distance between the points and is .
Sample Input 3Copy
C F
Sample Output 3Copy
10