2864 - Sotron: Revision history

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

4 December 2023

  • curprev 15:2515:25, 4 December 2023Raul talk contribs 671 bytes +671 Pagină nouă: function main() { let P, N, M, R, C, nrp, nr, n1, n2, k, x; P = parseInt(f); N = parseInt(f); M = parseInt(f); if (P === 1) { g.write(N * (N + 1) / 2 + "\n"); } else { nr = 2 * N - 1; x = nr; nrp = 0; k = 1; while (M <= nrp || M > nrp + x) { nrp += x; x -= 4; ++k; } n1 = (k - 1) * (nr + 4 - 2 * k) + 1; n2 = N + n1 + 1 - 2 * k; if (M <= n2...