/* Mrs Timpkin's Age in Picat. From http://www.comp.nus.edu.sg/~henz/projects/puzzles/arith/index.html """ Mrs Timpkin's Age from "Amusements in Mathematics, Dudeney", number 43. When the Timpkinses married eighteen years ago, Timpkins was three times as old as his wife, and today he is just twice as old as she. How old is Mrs. Timpkin? Model created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp. main => go. go => write(findall(LD, $timpkin(LD))),nl. timpkin(LD) => LD = [T, W], LD :: 1..100, T - 18 #= 3 * (W - 18), T #= 2 * W, solve([],LD).