#P11784. Luogu Problem Navigation

    ID: 13880 Type: Default 1000ms 256MiB

Luogu Problem Navigation

Luogu Problem Navigation

In Luogu's main page, there is a "problem navigation" feature which allows users to jump to a specific problem by entering its problem code. The URL to any problem is constructed as (https://www.luogu.com.cn/problem/), where () is derived from the user input.

The problem codes on Luogu follow a special pattern:
- The first character is one of the following: P, B, C, A, S, U, T (all are visible ASCII characters with codes in ([33,126])).
- For theme library problems (those whose code begins with 'P'), the problem code is composed of the letter 'P' followed by a sequence of digits, e.g. (P1145) or (P10000). In such cases, the leading 'P' can be omitted when entered by the user. For example, if the user enters (1001), it should be interpreted as (P1001).

Your task is to process the user input string and output the correct URL.

inputFormat

A single line containing a string which represents the problem code entered by the user. The string may or may not include the leading 'P' for theme library problems.

outputFormat

Print the URL of the problem in the following format: (https://www.luogu.com.cn/problem/), where () is the processed problem code. If the user input begins with a digit, it should be treated as a theme library problem and a leading 'P' must be prepended; otherwise, output the input string as it is.

sample

1001
https://www.luogu.com.cn/problem/P1001