there supermarket frequent customer the product sell supermarket represent parallel integer array product price ith product ID productsi price pricesiWhen customer pay bill represent parallel integer array product jth product purchase ID productj amountj product buy their subtotal calculate sum amountj price jth productThe supermarket decide sale every nth customer pay grocery give percentage discount the discount give discount give discount percent subtotal more formally subtotal bill actually pay bill 100 discount 100implement Cashier classcashierint n int discount int product int price Initializes object n discount product pricesdouble getbillint product int return final total bill discount apply Answers 105 actual value accept Example 1inputcashiergetbillgetbillgetbillgetbillgetbillgetbillgetbill350123456710020030040030020010012123710101234567111111141073101075316421010109997235532outputnull500040000800040000400007350025000explanationcashier cashier new Cashier3501234567100200300400300200100cashiergetBill1212 return 5000 1st customer discount bill 1 100 2 200 500cashiergetbill371010 return 40000 2nd customer discount bill 10 300 10 100 4000cashiergetbill12345671111111 return 8000 3rd customer 50 discount original bill 1600 actual bill 1600 100 50 100 800cashiergetbill410 return 40000 4th customer discountcashiergetbill731010 return 40000 5th customer discountcashiergetbill75316421010109997 return 73500 6th customer 50 discount original bill 14700 actual bill 14700 100 50 100 7350cashiergetbill235532 return 25000 6th customer discount Constraints1 n 1040 discount 1001 productslength 200priceslength productslength1 productsi 2001 pricesi 1000The element product unique1 productlength productslengthamountlength productlengthproductj exist products1 amountj 1000The element product uniqueAt 1000 call getBillAnswers 105 actual value accept