Problem Z: 求序列中所有递增或递减子串的个数并输出子串

Problem Z: 求序列中所有递增或递减子串的个数并输出子串

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

SubmitProblemList

Description

输入一个由10个整数组成的序列,其中序列中任意连续三个整数都互不相同,求该序列中所有递增或递减子串的个数。
子串:数字序列中连续元素构成的子序列

Input

输入只有一行,包括10个整数。之间用一个空格分开。

Output

输出的第一行,包括1个整数n,后面跟着n行,为n个子串。

Sample Input Copy

2 5 8 6 155 366 98 42 36 55​

Sample Output Copy

5
2 5 8
8 6
6 155 366
366 98 42 36
36 55