#include #define max(a,b) ((a)>(b)?(a):(b)) int main() { int n; scanf("%d",&n); int hi[n],dp[n]; for(int i=0;i