#abc305b. B - ABCDEFG
B - ABCDEFG
Score : points
问题描述
有7个点A、B、C、D、E、F和G按照顺序位于一条直线上。(参见下图)
- A与B之间的距离:3
- B与C之间的距离:1
- C与D之间的距离:4
- D与E之间的距离:1
- E与F之间的距离:5
- F与G之间的距离:9

已给出两个大写英文字母和。其中,和分别为A、B、C、D、E、F或G,并且满足。
请计算点和点之间的距离。
以上为通义千问 qwen-max 翻译,仅供参考。
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 1
A C
Sample Output 1
4
The distance between the points and is .
Sample Input 2
G B
Sample Output 2
20
The distance between the points and is .
Sample Input 3
C F
Sample Output 3
10
update @ 2024/3/10 08:35:53