A. Robot Sequence time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Calvin the robot lies in an infinite rectangular grid. Calvin's source code contains a list of n commands, each either 'U'…