2021-06-15 00:49:18 -07:00
|
|
|
---
|
|
|
|
id: 5900f4f11000cf542c510002
|
2022-03-04 19:46:29 +05:30
|
|
|
title: 'Problema 388: Linee Distinte'
|
2021-06-15 00:49:18 -07:00
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 302052
|
|
|
|
dashedName: problem-388-distinct-lines
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2022-03-04 19:46:29 +05:30
|
|
|
Considera tutti i punti del reticolo ($a$, $b$, $c$) con $0 ≤ a, b, c ≤ N$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2022-03-04 19:46:29 +05:30
|
|
|
Dall'origine $O(0, 0, 0)$ tutte le linee sono disegnate verso gli altri punti del reticolo. Sia $D(N)$ il numero di linee distinte.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2022-03-04 19:46:29 +05:30
|
|
|
Ti è dato che $D(1\\,000\\,000) = 831\\,909\\,254\\,469\\,114\\,121$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2022-03-04 19:46:29 +05:30
|
|
|
Trova $D({10}^{10})$. Dai come risposta le prime nove cifre seguite dalle ultime nove cifre.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2022-03-04 19:46:29 +05:30
|
|
|
`distinctLines()` should return `831907372805130000`.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
```js
|
2022-03-04 19:46:29 +05:30
|
|
|
assert.strictEqual(distinctLines(), 831907372805130000);
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
2022-03-04 19:46:29 +05:30
|
|
|
function distinctLines() {
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-03-04 19:46:29 +05:30
|
|
|
distinctLines();
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|