#K86837. Non-Overshadowed Trees

    ID: 36953 Type: Default 1000ms 256MiB

Non-Overshadowed Trees

Non-Overshadowed Trees

Given the heights of trees in a rainforest, your task is to identify those trees that are non-overshadowed. A tree is considered non-overshadowed if there is no tree to its right with a strictly greater height. Formally, for a tree at position \(i\) (1-indexed), it is non-overshadowed if:

\(\text{height}[i] > \max\{\text{height}[j] : j > i\}\)

You are required to output the positions (1-indexed) of all such trees. If no such tree exists, print "None".

inputFormat

The input consists of two lines. The first line contains an integer (n), the number of trees. The second line contains (n) space-separated integers representing the heights of the trees.

outputFormat

Output the 1-indexed positions of the non-overshadowed trees in order, separated by a single space. If there are no such trees, output "None".## sample

5
6 9 7 4 8
2 5