All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Cross-Country Runners (Posted on 2006-12-23) Difficulty: 3 of 5
Three six-member cross-country race teams hold a race. The 18 racers run simultaneously, and individually finish in 1st, 2nd, 3rd, ... , 18th place; there are no ties. The winning team is decided by which has the lowest total of place values of its first four placers, so that if a given team had members placing, say, 1st, 4th, 9th, 10th, 12th and 17th, that team's total would be 1+4+9+10=24. Again, a low team score therefore beats a high score.

In this race, no two of the three teams had the same score, and the third team's score was a multiple of the second team's score, which itself was a multiple of the winning team's score.

The sum of the positions (places) of the first three finishers on the winning team was the same as the total of the first two finishers on the second team. It also matched the place number of the first finisher on the third team.

What teams did each of the 18 place finishers belong to?

  Submitted by Charlie    
Rating: 3.6667 (3 votes)
Solution: (Hide)
Since the third team's lead runner's place was the same as the total of the first team's first three runners' places, that was at least 6th place (1+2+3), the basis for the "IF ix3 > 5 THEN" statement in the program below. The identifier "1" designates a player on the team which had the first runner across the finish line, but not necessarily the winning team. The identifier "3" refers to a member of the last-place team. Actual counts determine whether the team designated by the "1" or by the "2" was the winning team.

DECLARE SUB permute (a$)
CLS
o$ = "111111222222333333"
h$ = o$
DO
ix3 = INSTR(o$, "3")
IF ix3 > 5 THEN
ix31 = ix3
ix32 = INSTR(ix31 + 1, o$, "3")
ix33 = INSTR(ix32 + 1, o$, "3")
ix34 = INSTR(ix33 + 1, o$, "3")
score3 = ix31 + ix32 + ix33 + ix34
ix11 = 1
ix12 = INSTR(ix11 + 1, o$, "1")
ix13 = INSTR(ix12 + 1, o$, "1")
ix14 = INSTR(ix13 + 1, o$, "1")
score1 = ix11 + ix12 + ix13 + ix14
ix21 = INSTR(o$, "2")
ix22 = INSTR(ix21 + 1, o$, "2")
ix23 = INSTR(ix22 + 1, o$, "2")
ix24 = INSTR(ix23 + 1, o$, "2")
score2 = ix21 + ix22 + ix23 + ix24
IF score2 < score1 THEN
winner = 2: best = score2: best2 = score1
ELSE
winner = 1: best = score1: best2 = score2
END IF
IF best2 MOD best = 0 THEN
IF score3 MOD best2 = 0 THEN
IF winner = 1 THEN
IF ix11 + ix12 + ix13 = ix21 + ix22 AND ix21 + ix22 = ix31 THEN
PRINT o$; score1; score2; score3
END IF
ELSE
IF ix21 + ix22 + ix23 = ix11 + ix12 AND ix11 + ix12 = ix31 THEN
PRINT o$; score1; score2; score3
END IF
END IF
END IF
END IF
END IF
permute o$
LOOP UNTIL LEFT$(o$, 2) = "13"

The program itself does not check that each team has a different score, but the results can be examined for that:

121112133313332222 13 39 39
121112231122323333 13 26 52

In the first row, the team designated 2 and that designated 3, each have 39 points. Thus the second row is the answer, and indeed the team designated "1" (the one with the first runner crossing the finish line) did in fact win the race, with 13 points, against 26 and 52 for the other two teams. The team identification for the place positions is

121112231122323333.


From Enigma No. 1418, by Richard England, New Scientist, 18 November 2006.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Solutionre: SolutionDej Mar2006-12-23 17:26:33
SolutionSolutionPenny2006-12-23 12:49:01
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information