第 20 场 Codeforces Alpha Round(Codeforces 赛制)
A
BerOS 文件系统
BerOS file system
Codeforces
1700
原题
←B →

BerOS 文件系统AI (CI翻译)

The new operating system BerOS has a nice feature. It is possible to use any number of characters '/' as a delimiter in path instead of one traditional '/'. For example, strings //usr///local//nginx/sbin// and /usr/local/nginx///sbin are equivalent. The character '/' (or some sequence of such characters) at the end of the path is required only in case of the path to the root directory, which can be represented as single character '/'.

BerOS 新操作系统具有一项很棒的功能:在路径中,可以使用任意数量的字符 '/' 作为分隔符,而不必使用传统的单个 '/'。例如,字符串 //usr///local//nginx/sbin// 和 /usr/local/nginx///sbin 是等价的。路径末尾的字符 '/'(或由这些字符组成的序列)仅在路径指向根目录时是必需的,根目录可以用单个字符 '/' 表示。AI (CI翻译)

A path called normalized if it contains the smallest possible number of characters '/'.

如果一个路径中包含的字符 '/' 数量尽可能少,则称该路径为规范化路径。AI (CI翻译)

Your task is to transform a given path to the normalized form.

你的任务是将给定路径转换为规范化形式。AI (CI翻译)

Input

输入格式

AI (CI翻译)

The first line of the input contains only lowercase Latin letters and character '/' — the path to some directory. All paths start with at least one character '/'. The length of the given line is no more than 100 characters, it is not empty.

输入的第一行仅包含小写拉丁字母和字符 '/',表示某个目录的路径。所有路径都至少以一个字符 '/' 开头。给定行的长度不超过 100 个字符,且不为空。AI (CI翻译)

Output

输出格式

AI (CI翻译)

The path in normalized form.

输出规范化形式的路径。AI (CI翻译)

样例

Input #1
//usr///local//nginx/sbin
Output #1
/usr/local/nginx/sbin
InputCopy OutputCopy
题目信息
题号
20A
时间限制
2 s
内存限制
64 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。