#K13141. European to American Date Conversion

    ID: 23847 Type: Default 1000ms 256MiB

European to American Date Conversion

European to American Date Conversion

You are given a text that may contain dates in the European date format DD/MM/YYYY. Your task is to convert each valid date into the American format MM/DD/YYYY if it is a valid calendar date. If a date is not valid, leave it unchanged.

A valid date is one that can be correctly parsed using the standard Gregorian calendar. For example, the date 31/12/2023 is valid and should be converted to 12/31/2023, whereas an invalid date such as 45/50/9999 remains unchanged.

You must read the input text from standard input (stdin) and output the converted text to standard output (stdout).

inputFormat

The input consists of a single string (which may span multiple lines) containing text. This text may include dates in the European format DD/MM/YYYY.

outputFormat

The output is a single string that is identical to the input text except that every valid date in European format has been converted to the American format MM/DD/YYYY. Dates that are not valid must remain unchanged.

## sample
I have meetings on 25/12/2023 and 01/01/2024.
I have meetings on 12/25/2023 and 01/01/2024.