codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

245B.md (1990B)


      1 Source: https://codeforces.com/problemset/problem/245/B
      2 
      3 B. Internet Address
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format:
     22 
     23  <protocol>://<domain>.ru[/<context>] 
     24 
     25 where:
     26 
     27 * <protocol> can equal either "http" (without the quotes) or "ftp" (without the quotes),
     28 * <domain> is a non-empty string, consisting of lowercase English letters,
     29 * the /<context> part may not be present. If it is present, then <context> is a non-empty string, consisting of lowercase English letters.
     30 
     31 If string <context> isn't present in the address, then the additional character "/" isn't written. Thus, the address has either two characters "/" (the ones that go before the domain), or three (an extra one in front of the context).
     32 
     33 When the boy came home, he found out that the address he wrote in his notebook had no punctuation marks. Vasya must have been in a lot of hurry and didn't write characters ":", "/", ".".
     34 
     35 Help Vasya to restore the possible address of the recorded Internet resource.
     36 
     37 Input
     38 
     39 The first line contains a non-empty string that Vasya wrote out in his notebook. This line consists of lowercase English letters only.
     40 
     41 It is guaranteed that the given string contains at most 50 letters. It is guaranteed that the given string can be obtained from some correct Internet resource address, described above.
     42 
     43 Output
     44 
     45 Print a single line — the address of the Internet resource that Vasya liked. If there are several addresses that meet the problem limitations, you are allowed to print any of them.
     46 
     47 Examples
     48 
     49 Input
     50 
     51 ```
     52 httpsunrux
     53 ```
     54 
     55 Output
     56 
     57 ```
     58 http://sun.ru/x
     59 ```
     60 
     61 Input
     62 
     63 ```
     64 ftphttprururu
     65 ```
     66 
     67 Output
     68 
     69 ```
     70 ftp://http.ru/ruru
     71 ```
     72 
     73 Note
     74 
     75 In the second sample there are two more possible answers: "ftp://httpruru.ru" and "ftp://httpru.ru/ru".