ext_214513 (
http://users.livejournal.com/_fluffy/
) wrote
in
austin_dern
2012-10-02 05:38 am (UTC)
no subject
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]
(
6 comments
)
Post a comment in response:
From:
Anonymous
This account has disabled anonymous posting.
OpenID
Identity URL:
Log in?
Dreamwidth account
Account name
Password
Log in?
If you don't have an account you can
create one now
.
Subject
HTML doesn't work in the subject.
Formatting type
Casual HTML
Markdown
Raw HTML
Rich Text Editor
Message
[
Home
|
Post Entry
|
Log in
|
Search
|
Browse Options
|
Site Map
]
no subject
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]