Skip to main content

Posts

Showing posts with the label codeforces

The Delivery Dilemma Codeforces Problem code solution

 The Delivery Dilemma Codeforces Problem code solution - Problem statement- C. The Delivery Dilemma time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya is preparing for his birthday. He decided that there would be  n n  different dishes on the dinner table, numbered from  1 1  to  n n . Since Petya doesn't like to cook, he wants to order these dishes in restaurants. Unfortunately, all dishes are prepared in different restaurants and therefore Petya needs to pick up his orders from  n n  different places. To speed up this process, he wants to order courier delivery at some restaurants. Thus, for each dish, there are two options for Petya how he can get it: the dish will be delivered by a courier from the restaurant  i i , in this case the courier will arrive in  a i a i  minutes, Petya goes to the restaurant  i i  on his own and picks up the dish, he will spend  b i b i  minutes on this. Each restaurant has its own cour