Ayush cashier shopping center recently department start click collect service allow user shop online the store contain k item n customer service each user pay m item let aij denote jth item ith person orderdue space limitation item arrange single row when Ayush receive ith order find item aij 1jm row Let posx denote position item x row moment collection then Ayush take time equal posai1posai2posaim ith customerwhen Ayush access xth element keep new stock row take away xth element Thus value updatingyour task calculate total time take Ayush process ordersyou assume market endless stock