Women in Engg
All submissions for this problem are available.
The Women in Engineering (WIE) affinity group of IEEE DTU are organizing Vihaan. The chief organisers Arushi, Ashna, Sugandha, Deepanshi and Lokeshwar of Vihaan decide to unwind after a grueling session of working. They decide to play a game of cards, and agree that the loser will treat the others at a cafe. Worried about losing the game, Arushi needs help to calculate the probability of winning. There are n cards on the table. Each card has a number written on it. The probability Pi percent is probability that i-th card is numbered with Ai and , probability 100-Pi percent it can be numbered with Bi . It can not have be any other number. Arushi wins if and only if all tickets have distinct numbers.Help Arushi by calculating her winning probability.
First line of input is the number of test cases t . Then for each test case , next line contains ‘n’ then n lines follow, consisting of Pi Ai Bi .
Only one line per test case, the probability of winning of chef.( ans less than 10-6 error will be accepted).
1<=t<=10, 1<=n<=100, 0<= Pi <=100 , 1<= Ai <=15, 1<= Bi <=15.
Input: 2 2 50 3 4 50 4 3 2 50 3 4 50 5 6 Output: 0.500000000 1.000000000
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.