#CCBCHBAHAI0000019. Đếm lần tăng/giảm giữa hai phần tử kề (Count Adjacent Increases and Decreases)
Đếm lần tăng/giảm giữa hai phần tử kề (Count Adjacent Increases and Decreases)
Count Adjacent Increases and Decreases
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given , let count adjacent strict increases and count adjacent strict decreases. Equal adjacent values count toward neither. Print and .
Input
Line 1 contains . Line 2 contains .
Output
Print and .
Subtasks
Subtask 1 (20 points): ; .
Subtask 2 (30 points): ; .
Subtask 3 (50 points): ; .
Example
Input
6
3 5 5 2 7 1
Output
2 2
Explanation
The values follow directly from the definitions and illustrate the valid index range of the array scan.