Sum and product puzzle: Difference between revisions

m
Line 2,122:
=={{header|Picat}}==
<lang Picat>
import cp.
main =>
N = 98,
Line 2,130 ⟶ 2,129:
% Fact 1: S says "P does not know X and Y.", i.e.
% For every possible sum decomposition of the number X+Y, the product has in turn more than one product decomposition:
Solutions1 = [[X,Y] : X in 2..N-1, Y in X+1..100-X, foreach(XX in 2..X+Y-3) PD[XX * (X+Y-XX)] #> 1 end],
% Fact 2: P says "Now I know X and Y.", i.e.
% The number X*Y has only one product decomposition for which fact 1 is true: