Created
May 25, 2015 16:21
-
-
Save benallard/07629ad80c77eb2ccacd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "alldifferent.mzn"; | |
var 1..9: a; | |
var 1..9: b; | |
var 1..9: c; | |
var 1..9: d; | |
var 1..9: e; | |
var 1..9: f; | |
var 1..9: g; | |
var 1..9: h; | |
var 1..9: i; | |
constraint a + 13 * b div c + d + 12 * e - f - 11 + g * h div i - 10 = 66; | |
constraint 13 * b mod c = 0; | |
constraint g * h mod i = 0; | |
constraint alldifferent([a,b,c,d,e,f,g,h,i]); | |
solve satisfy; | |
output [show(a), show(b), show(c), show(d), show(e), show(f), show(g), show(h), show(i), "\n"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replacing the "div" with "/", and removing both "mod" constraint, we can get the 'rational' solutions: