Skip to content

Commit

Permalink
Update and rename Three Friends.txt to README.me
Browse files Browse the repository at this point in the history
  • Loading branch information
IndraAdhikary authored Sep 18, 2020
1 parent 5feb77c commit 876dd54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Three Friends/Three Friends.txt → Three Friends/README.me
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Three Friends
Three Friends
https://codeforces.com/problemset/problem/1272/A
Three friends are going to meet each other. Initially, the first friend stays at the position x=a, the second friend stays at the position x=b and the third friend stays at the position x=c on the coordinate axis Ox.In one minute each friend independently from other friends can change the position x by 1 to the left or by 1 to the right (i.e. set x:=x−1 or x:=x+1) or even don't change it.
Let's introduce the total pairwise distance — the sum of distances between each pair of friends. Let a′, b′ and c′ be the final positions of the first, the second and the third friend, correspondingly. Then the total pairwise distance is |a′−b′|+|a′−c′|+|b′−c′|, where |x| is the absolute value of x.
Expand All @@ -22,4 +22,4 @@ Output
1999999994
1999999994
2
4
4

0 comments on commit 876dd54

Please sign in to comment.