ext_214513 ([identity profile] http://users.livejournal.com/_fluffy/) wrote in [personal profile] austin_dern 2012-10-02 05:38 am (UTC)

hahaha no actually it's just one line.

paytherent(X,[A,B1,B2,C1,C2,D]) :- permutation(X,[A,B1,B2,C1,C2,D]), B1<B2, B1+B2 > A, C1<C2, C1+C2 > B1+B2, D > C1+C2.

According to this, there are actually a few different solutions for the one you listed there:

| ?- paytherent([180,379,549,159,229,359],X).

X = [379,180,229,159,359,549] ? a

X = [379,159,229,180,359,549]

X = [229,159,379,180,359,549]

X = [359,180,229,159,379,549]

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting