freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-453-lattice-quadrilaterals.english.md
Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

1.1 KiB

id, challengeType, title
id challengeType title
5900f5311000cf542c510044 5 Problem 453: Lattice Quadrilaterals

Description

A simple quadrilateral is a polygon that has four distinct vertices, has no straight angles and does not self-intersect.

Let Q(m, n) be the number of simple quadrilaterals whose vertices are lattice points with coordinates (x,y) satisfying 0 ≤ x ≤ m and 0 ≤ y ≤ n.

For example, Q(2, 2) = 94 as can be seen below:

It can also be verified that Q(3, 7) = 39590, Q(12, 3) = 309000 and Q(123, 45) = 70542215894646.

Find Q(12345, 6789) mod 135707531.

Instructions

Tests

tests:
  - text: <code>euler453()</code> should return 104354107.
    testString: assert.strictEqual(euler453(), 104354107, '<code>euler453()</code> should return 104354107.');

Challenge Seed

function euler453() {
  // Good luck!
  return true;
}

euler453();

Solution

// solution required