Under construction

Still being built. Things may change

Vaccine Efficacy

Interview

Time limit1sMemory limit1024 MB

Summary
Given N participants marked as vaccinated or control and infected by strains A, B, C, compute each strain's vaccine efficacy as a percentage reduction in infection rate, or print Not Effective.
Level

Easy3 of 10

Topics
Implementation, Math, Array
Solved
No attempts yet

Problem

A clinical trial is needed to determine the efficacy of a vaccine against a disease. Some participants are given the real vaccine, while others are given a placebo as the control group. The participants are tracked to determine whether they are infected by three different strains (A, B, and C) of a virus. The efficacy of the vaccine against infection by a particular strain is the percentage reduction of the infection rate of the vaccinated group compared to the control group.

For example, suppose that there are 4040 people in the vaccinated group, 88 of which are infected by strain B. Then the infection rate is 2020%. Further suppose that 5050 people are in the control group, and 3030 people are infected by strain B. Then the infection rate for the control group is 6060%. Thus the vaccine efficacy against infection is approximately 66.6766.67% (since 2020% is a 66.6766.67% percentage reduction of 6060%). If the infection rate for a particular strain in the vaccinated group is not lower than that of the control group, the vaccine is not effective against infection by that strain.

What is the vaccine efficacy against infection by the three strains?

Input

The first line of input contains an integer NN (2≤N≤10 0002 \leq N \leq 10\,000), the number of participants in the clinical trial.

The next NN lines describe the participants. Each of these lines contains a string of length four. Each letter is either 'Y' or 'N'. The first letter indicates whether the participant is vaccinated with the real vaccine, and the remaining three letters indicate whether the participant is infected by strain A, B, and C, respectively.

There is at least one participant in the vaccinated group and the control group. There is at least one participant in the control group infected by each strain (but they may be different participants).

Output

Display the vaccine efficacy against infection by strain A, B, and C in that order. If the vaccine is not effective against infection by a particular strain, display Not Effective for that strain instead. Answers with an absolute error or relative error of at most 10−210^{-2} will be accepted.

Examples2

  1. Example 1

    Input
    10
    NYNY
    NNYY
    NYYY
    NYYN
    NNNY
    YYNN
    YYYN
    YYNY
    YYNN
    YYNY
    
    Expected output
    Not Effective
    66.666667
    50.000000
    
  2. Example 2

    Input
    8
    NYYY
    NYYY
    NYYY
    NYYY
    YNNN
    YNNN
    YNNN
    YNNN
    
    Expected output
    100.000000
    100.000000
    100.000000