MWC '15 #4 P1: Love Guru 2

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

After a scandal in which Hypnova's clients discovered that his match-making algorithms were dependent on the two individual's names, he is trying to recover.

Hypnova says:

Love is dependent on the individual

Hypnova demonstrates this by using a love triangle consisting of 3 people, A, B and C. As Hypnova is busy dealing with unhappy clients, he has no time to create a program to demonstrate this. Surely, he has called upon your help!

You can read about Hypnova's love match algorithm here. In short, each person's name is applied to a non-random, mathematical function which returns a value [1, 10]. The compatibility of two people are the sum of the two results from the function. Thus, the compatibility between two people is [2, 20].

Given 3 integers, three compatibilities between the three people ((A, B), (B, C) and (A,C)), find the maximum compatibility that A, B and C can have with anyone.

Input Specification

3 space separated integers: the compatibilities explained above. The numbers are in the range [2, 20]. It is guaranteed that the 3 compatibilities are possible.

Output Specification

3 space separated integers denoting the maximum compatibility of A, B and C respectively. The numbers should be in the range [2, 20].

Sample Input

20
15
15

Sample Output

20
20
15

Comments


  • 2
    maxcruickshanks  commented on July 13, 2020, 9:42 p.m.

    For anyone having trouble interpreting this problem statement, anyone refers to a person with a value from 0 to 10 (instead of just A, B, and C as their matches).