A sequence of numbers has a well if it contains three consecutive numbers such that that the endpoints add up more than twice the one in the middle.
Formally, has a well if it exists at least an with such that .
Write a program that, given an integer , writes all sequences with no well that can be obtained by reordering the sequence .
The input consists of an integer .
Write all sequences with no well that can be obtained by reordering the sequence . You can write the sequences in any order.
Author: Albert Oliveras
Generation: 2026-01-25T15:58:06.529Z
© Jutge.org, 2006–2026.
https://jutge.org