/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
final int numberOfAttempts = 1000000;
int numberOfOccurences = 0;
for (int i=0;i<numberOfAttempts;i++) {
//initialize voters
List<Boolean> voters = new ArrayList<>();
for (int j = 0; j < 7; j++) {
voters.add(true);
}
for (int j = 0; j < 11; j++) {
voters.add(false);
}
//There shouldn't be any minus after first five votes
boolean minusVote = false;
for (int k = 0; k<5;k++){
if (!voters.get(k)){
minusVote=true;
break;
}
}
if (!minusVote){
numberOfOccurences++;
}
}
System.
out.
println("Probability: "+100*(double)numberOfOccurences
/numberOfAttempts
+"%"); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWZpbmFsIGludCBudW1iZXJPZkF0dGVtcHRzID0gMTAwMDAwMDsKICAgICAgICBpbnQgbnVtYmVyT2ZPY2N1cmVuY2VzID0gMDsKICAgICAgICBmb3IgKGludCBpPTA7aTxudW1iZXJPZkF0dGVtcHRzO2krKykgewogICAgICAgICAgICAvL2luaXRpYWxpemUgdm90ZXJzCiAgICAgICAgICAgIExpc3Q8Qm9vbGVhbj4gdm90ZXJzID0gbmV3IEFycmF5TGlzdDw+KCk7CiAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgNzsgaisrKSB7CiAgICAgICAgICAgICAgICB2b3RlcnMuYWRkKHRydWUpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgMTE7IGorKykgewogICAgICAgICAgICAgICAgdm90ZXJzLmFkZChmYWxzZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgQ29sbGVjdGlvbnMuc2h1ZmZsZSh2b3RlcnMpOwogICAgICAgICAgICAvL1RoZXJlIHNob3VsZG4ndCBiZSBhbnkgbWludXMgYWZ0ZXIgZmlyc3QgZml2ZSB2b3RlcwogICAgICAgICAgICBib29sZWFuIG1pbnVzVm90ZSA9IGZhbHNlOwogICAgICAgICAgICBmb3IgKGludCBrID0gMDsgazw1O2srKyl7CiAgICAgICAgICAgICAgICBpZiAoIXZvdGVycy5nZXQoaykpewogICAgICAgICAgICAgICAgICAgIG1pbnVzVm90ZT10cnVlOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmICghbWludXNWb3RlKXsKICAgICAgICAgICAgICAgIG51bWJlck9mT2NjdXJlbmNlcysrOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiUHJvYmFiaWxpdHk6ICIrMTAwKihkb3VibGUpbnVtYmVyT2ZPY2N1cmVuY2VzL251bWJlck9mQXR0ZW1wdHMgKyIlIik7Cgl9Cn0=