Content
D. Boris and His Amazing Haircut time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Boris thinks that chess is a tedious game. So he left his tournament early and went to a barber shop as his hair was a bit messy. His current hair can be described by an array a1, 2, . .., an, where a; is the height of the hair standing at position i. His desired haircut can be described by an array b1, b2, . . . , On, in a similar fashion. Front Side