enter image description here
this is a picture with a task condition
I tried to write the code. but it gives an error immediately on the 1st attempt.please help me write the code. In Python, c++, Javascript We need the right decision, and very urgently.