The Upload Server
Practice
3.3 (6 votes)
Basic programming
Basics of implementation
Easy
Implementation
Problem
20% Success 4501 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

A new website to host video and music is built up by the company X. The engineers at are facing a major issue in identifying whether the data they receive in one of their API is of video or music.

Now, you will be given $$N$$ lines of data. Each line of data consists a list of strings. Each string either represents an integer or a name. For each line of data, you need to check whether that data corresponds to a music or a video.

You need to follow the following rules to detect the data and store it:

  1. A Music data consists of a name and an integer that denote the bitrate and nothing else.
  2. A video data consists of a name and two integers that denote the resolution of the video and nothing else.
  3. Rest of the data which does not match any of the formats above is to be ignored.
  4. A music or a video name can consist of integers but it will contain at least one character of the English alphabets.
  5. An integer in the data will consist only of integers, and it will never start with 0.

For each line of data, if it satisfies the constraints of a music then print M, if it satisfies constraints of a video print V, or else print which means that the data has to be ignored.

Input Format

The first line contains an integer $$N$$ as input denoting the total numbers of lines in the input.
Next $$N$$ lines contains either two strings or three strings separated by space.

Output Format

For each data, you need to print either of the three characters N, V or M.

Constraints

$$1 \le N \le 10^5$$
$$1 \le word \le 15$$ where $$word$$ is the name of either music or a video.
$$1 \le bitrate \le 10^{32}$$ where $$bitrate$$ is the bitrate of the song.
$$1 \le res_x , res_y \le 10^{32}$$  where $$res_x$$ and $$res_y$$ denote the width and height of video in pixels.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
22 votes
Tags:
Basic ProgrammingBasics of ImplementationEasyException handlingImplementationjava
Points:30
6 votes
Tags:
ApprovedBinary SearchMathMediumOpenSorting
Points:20
47 votes
Tags:
Basic ProgrammingEasyImplementation