## 2 Results  
**Theorem 2**.: _There exists a sequence \(T\) of length \(n\geq 1\) containing a longest increasing subsequence of length \(x=\mathit{lis}(T)\geq 1\) and a longest decreasing subsequence of length \(y=\mathit{lds}(T)\geq 1\) if and only if the numbers \(x\), \(y\) and \(n\) satisfy the following conditions:_  
\[x\cdot y\geq n \tag{1}\]  
\[x+y\leq n+1. \tag{2}\]  
Proof.: If either \(x=1\) or \(y=1\) the claim is evident.  
In what follows, \(x>1,y>1\), and \(n>1\).  
**Necessity** of the condition (1) immediately follows from the theorem of [PERSON]. Assume that the condition (1) is not satisfied, i.e., \(x\cdot y\leq n-1\), then, according to the Erdos-Szekeres theorem, the sequence \(T\) of length \(n\) contains a monotone increasing subsequence of the length \(x+1\) or a monotone decreasing subsequence of the length \(y+1\), which contradicts the hypothesis of the theorem. The violation of the condition (2) makes impossible the existence of two subsequences with specified lengths, one of which increases, while the other decreases. In fact, these two subsequences can have no more than one element in common; that is, the sum of their lengths should not exceed \(n+1\).  
**Sufficiency**. Assume that \(x\cdot y\geq n\) and \(x+y\leq n+1\), and build a sequence \(T\) of length \(n\), such that \(x=lis(T),y=lds(T)\). This sequence is built according to the following scheme. We take a sequence of \(n\) natural numbers \(1,2,\ldots,n\) and divide it into \(x\) groups, in such a way that \(T=Concatenation(T_{1},T_{2},\ldots,T_{x})\) and satisfies the following conditions:  
1. The numbers in each group are arranged in decreasing order.
2. All the numbers of a subsequent group are greater than all the numbers of a preceding group.
3. The first group consists of \(y\) elements: \(y,y-1,y-2,\ldots,1\), which is possible by the condition \(y<n\).
4. We divide the remaining \(n-y\) elements into \(x-1\) groups as follows. Let \(p=\left\lfloor\dfrac{n-y}{x-1}\right\rfloor\) and \(r=(n-y)\operatorname{mod}(x-1)\). Note that \(p=\left\lfloor\dfrac{n-y}{x-1}\right\rfloor\geq\left\lfloor\dfrac{x-1}{x-1} \right\rfloor=1\) and \(0\leq r<x-1\). The first \(r\) groups represent decreasing subsequences \(T_{2},\ldots,T_{r+1}\) of the length \(p+1\): \(T_{2}=\{y+p+1,y+p,y+p-1,\ldots,y+1\}\)... \(T_{r+1}=\{y+r(p+1),y+r(p+1)-1,\ldots  
\[T=(3,2,1,\ 5,4,\ 6,\ 7).\]  
Clearly, the longest decreasing sequence of \(T\) is \((3,2,1)\) and has length \(y=3\), and the longest increasing subsequences each have length \(x=4\).  
There are other methods of building sequences satisfying the conditions (1) and (2). For instance, by choosing the last group to be the longest decreasing subsequence rather than the first, or, say, by first creating the group consisting of \(x\) increasing integers \(n-x+1,n-x+2,\ldots,n\), and then adding \(y-1\) increasing groups of nearly equal size so that all the numbers in each group is smaller than the numbers in any previous group.  
Conceptualization, E.J.I.; Investigation, V.E.L.; Writing-original draft preparation, V.E.L.; Writing-review and editing, E.J.I.  
This research received no external funding.  
We would like to thank the reviewers for their comments, which helped us to improve the presentation of the paper.  
The authors declare no conflict of interest.