include "globals.mzn";

% Given an integer n and a real e
par int:   n = 566*708;
par float: e = 16/9;

% Find two integers r <= c
var int: r; var int: c;
constraint c >= r;
output [
  "Rows: ",    show(r), "\n",
  "Columns: ", show(c), "\n"
];

% Such that (r-1)c < n <= rc
constraint
  ((r-1)*c) < n
  /\
  n <= (r*c);

% And the ratio c/r is as close to e as possible.
solve minimize abs(c/r - e);