Buggy python submission (verdict: Runtime Error):
n = int(input())

heads = list(map(float, input().split()))
# n = 2999
# heads = [0.75, 0.73, 0.61, 0.77, 0.2, 0.34, 0.56, 0.2, 0.08, 0.43, 0.26, 0.09, 0.73, 0.38, 0.19, 0.1, 0.57, 0.85, 0.25, 0.38, 0.95, 0.49, 0.06, 0.66, 0.8, 0.83, 0.5, 0.44, 0.77, 0.03, 0.2, 0.69, 0.83, 0.81, 0.23, 0.56, 0.7, 0.59, 0.58, 0.04, 0.26, 0.63, 0.18, 0.95, 0.5, 0.31, 0.23, 0.22, 0.8, 0.08, 0.13, 0.2, 0.94, 0.86, 0.91, 0.43, 0.44, 0.89, 0.94, 0.05, 0.72, 0.06, 0.94, 0.71, 0.74, 0.31, 0.55, 0.31, 0.48, 0.22, 0.62, 0.91, 0.43, 0.45, 0.73, 0.41, 0.67, 0.32, 0.74, 0.59, 0.11, 0.21, 0.18, 0.57, 0.41, 0.58, 0.24, 0.04, 0.45, 0.34, 0.37, 0.76, 0.22, 0.97, 0.87, 0.57, 0.13, 0.1, 0.52, 0.65, 0.22, 0.31, 0.83, 0.42, 0.31, 0.78, 0.26, 0.84, 0.29, 0.23, 0.78, 0.03, 0.27, 0.19, 0.16, 0.53, 0.69, 0.8, 0.68, 0.71, 0.37, 0.5, 0.45, 0.38, 0.9, 0.79, 0.46, 0.8, 0.88, 0.64, 0.98, 0.2, 0.96, 0.81, 0.93, 0.59, 0.57, 0.99, 0.91, 0.69, 0.98, 0.6, 0.83, 0.62, 0.75, 0.01, 0.18, 0.22, 0.8, 0.35, 0.05, 0.74, 0.91, 0.17, 0.06, 0.89, 0.54, 0.05, 0.82, 0.1, 0.39, 0.31, 0.87, 0.48, 0.26, 0.26, 0.31, 0.25, 0.64, 0.5, 0.84, 0.69, 0.03, 0.3, 0.94, 0.04, 0.01, 0.13, 0.88, 0.33, 0.21, 0.67, 0.98, 0.12, 0.96, 0.4, 0.59, 0.97, 0.81, 0.27, 0.97, 0.33, 0.81, 0.35, 0.83, 0.6, 0.34, 0.39, 0.12, 0.88, 0.21, 0.45, 0.99, 0.1, 0.14, 0.23, 0.59, 0.61, 0.11, 0.96, 0.71, 0.31, 0.08, 0.44, 0.68, 0.66, 0.76, 0.9, 0.52, 0.84, 0.31, 0.27, 0.78, 0.81, 0.75, 0.33, 0.12, 0.36, 0.16, 0.35, 0.98, 0.6, 0.2, 0.51, 0.21, 0.68, 0.02, 0.89, 0.07, 0.16, 0.75, 0.38, 0.61, 0.21, 0.96, 0.57, 0.04, 0.17, 0.86, 0.75, 0.56, 0.05, 0.88, 0.06, 0.27, 0.7, 0.49, 0.53, 0.7, 0.9, 0.44, 0.64, 0.73, 0.76, 0.62, 0.85, 0.35, 0.54, 0.27, 0.12, 0.04, 0.82, 0.54, 0.63, 0.15, 0.12, 0.13, 0.44, 0.47, 0.21, 0.27, 0.38, 0.85, 0.37, 0.49, 0.33, 0.63, 0.97, 0.93, 0.27, 0.67, 0.02, 0.44, 0.02, 0.64, 0.27, 0.9, 0.12, 0.58, 0.81, 0.44, 0.76, 0.16, 0.06, 0.11, 0.96, 0.23, 0.09, 0.01, 0.5, 0.16, 0.66, 0.7, 0.3, 0.75, 0.62, 0.32, 0.47, 0.84, 0.13, 0.82, 0.5, 0.91, 0.34, 0.5, 0.56, 0.1, 0.76, 0.38, 0.27, 0.8, 0.15, 0.44, 0.23, 0.33, 0.93, 0.01, 0.85, 0.83, 0.64, 0.21, 0.9, 0.32, 0.01, 0.7, 0.24, 0.12, 0.2, 0.69, 0.22, 0.99, 0.88, 0.2, 0.83, 0.89, 0.14, 0.2, 0.45, 0.1, 0.85, 0.61, 0.01, 0.4, 0.21, 0.95, 0.47, 0.76, 0.48, 0.62, 0.87, 0.87, 0.92, 0.32, 0.89, 0.96, 0.34, 0.89, 0.39, 0.48, 0.92, 0.93, 0.01, 0.07, 0.07, 0.44, 0.18, 0.97, 0.15, 0.22, 0.1, 0.26, 0.03, 0.89, 0.24, 0.72, 0.86, 0.07, 0.74, 0.44, 0.66, 0.6, 0.33, 0.75, 0.83, 0.94, 0.57, 0.09, 0.69, 0.65, 0.34, 0.84, 0.53, 0.86, 0.07, 0.51, 0.3, 0.1, 0.82, 0.21, 0.79, 0.09, 0.79, 0.89, 0.83, 0.75, 0.84, 0.12, 0.71, 0.63, 0.69, 0.41, 0.86, 0.53, 0.09, 0.05, 0.15, 0.37, 0.74, 0.93, 0.73, 0.88, 0.16, 0.45, 0.99, 0.07, 0.52, 0.71, 0.58, 0.29, 0.93, 0.81, 0.81, 0.84, 0.88, 0.76, 0.64, 0.19, 0.79, 0.61, 0.56, 0.77, 0.29, 0.6, 0.02, 0.38, 0.28, 0.65, 0.76, 0.17, 0.22, 0.54, 0.55, 0.04, 0.66, 0.17, 0.65, 0.33, 0.36, 0.42, 0.72, 0.35, 0.3, 0.35, 0.62, 0.62, 0.98, 0.38, 0.14, 0.55, 0.67, 0.97, 0.75, 0.74, 0.41, 0.93, 0.41, 0.73, 0.77, 0.26, 0.69, 0.6, 0.08, 0.9, 0.83, 0.1, 0.57, 0.47, 0.19, 0.06, 0.72, 0.19, 0.57, 0.9, 0.87, 0.81, 0.34, 0.84, 0.38, 0.52, 0.73, 0.35, 0.39, 0.27, 0.88, 0.08, 0.13, 0.17, 0.83, 0.15, 0.99, 0.54, 0.13, 0.63, 0.75, 0.85, 0.23, 0.55, 0.06, 0.99, 0.75, 0.36, 0.24, 0.83, 0.18, 0.9, 0.67, 0.86, 0.27, 0.57, 0.14, 0.99, 0.84, 0.15, 0.02, 0.65, 0.85, 0.3, 0.01, 0.97, 0.89, 0.82, 0.34, 0.93, 0.35, 0.71, 0.09, 0.24, 0.12, 0.57, 0.55, 0.79, 0.91, 0.54, 0.3, 0.62, 0.46, 0.02, 0.36, 0.55, 0.48, 0.5, 0.76, 0.28, 0.67, 0.85, 0.31, 0.39, 0.49, 0.52, 0.16, 0.78, 0.25, 0.32, 0.76, 0.47, 0.85, 0.29, 0.78, 0.41, 0.69, 0.1, 0.64, 0.48, 0.27, 0.03, 0.76, 0.9, 0.02, 0.22, 0.89, 0.91, 0.84, 0.98, 0.18, 0.78, 0.02, 0.07, 0.69, 0.52, 0.02, 0.75, 0.4, 0.97, 0.97, 0.46, 0.67, 0.88, 0.86, 0.27, 0.06, 0.24, 0.01, 0.37, 0.45, 0.49, 0.75, 0.91, 0.33, 0.71, 0.83, 0.43, 0.34, 0.22, 0.71, 0.17, 0.35, 0.9, 0.77, 0.78, 0.28, 0.15, 0.95, 0.61, 0.31, 0.21, 0.05, 0.87, 0.84, 0.63, 0.31, 0.28, 0.01, 0.48, 0.17, 0.15, 0.3, 0.85, 0.28, 0.22, 0.87, 0.92, 0.34, 0.22, 0.21, 0.21, 0.67, 0.49, 0.97, 0.56, 0.32, 0.7, 0.46, 0.7, 0.7, 0.7, 0.9, 0.07, 0.12, 0.66, 0.11, 0.42, 0.99, 0.26, 0.91, 0.67, 0.07, 0.37, 0.45, 0.69, 0.4, 0.81, 0.11, 0.16, 0.57, 0.37, 0.36, 0.27, 0.89, 0.76, 0.03, 0.97, 0.39, 0.25, 0.39, 0.68, 0.2, 0.12, 0.21, 0.82, 0.38, 0.13, 0.15, 0.79, 0.11, 0.5, 0.56, 0.13, 0.99, 0.79, 0.94, 0.04, 0.29, 0.49, 0.64, 0.63, 0.87, 0.51, 0.59, 0.56, 0.69, 0.96, 0.92, 0.08, 0.26, 0.52, 0.26, 0.65, 0.58, 0.44, 0.46, 0.02, 0.73, 0.4, 0.06, 0.56, 0.34, 0.8, 0.99, 0.48, 0.65, 0.92, 0.27, 0.85, 0.75, 0.55, 0.75, 0.25, 0.53, 0.57, 0.81, 0.05, 0.93, 0.42, 0.27, 0.67, 0.57, 0.91, 0.18, 0.93, 0.6, 0.07, 0.73, 0.15, 0.83, 0.31, 0.4, 0.39, 0.87, 0.89, 0.71, 0.49, 0.02, 0.58, 0.87, 0.19, 0.15, 0.45, 0.76, 0.9, 0.78, 0.24, 0.31, 0.08, 0.69, 0.48, 0.64, 0.67, 0.45, 0.21, 0.36, 0.22, 0.09, 0.31, 0.61, 0.15, 0.84, 0.73, 0.95, 0.78, 0.25, 0.05, 0.72, 0.96, 0.15, 0.3, 0.6, 0.24, 0.83, 0.09, 0.2, 0.07, 0.6, 0.12, 0.02, 0.46, 0.58, 0.06, 0.29, 0.27, 0.65, 0.76, 0.39, 0.34, 0.05, 0.92, 0.14, 0.46, 0.43, 0.46, 0.92, 0.91, 0.42, 0.89, 0.81, 0.17, 0.55, 0.45, 0.52, 0.94, 0.69, 0.48, 0.34, 0.25, 0.19, 0.05, 0.47, 0.13, 0.3, 0.01, 0.55, 0.32, 0.85, 0.44, 0.16, 0.15, 0.21, 0.47, 0.19, 0.49, 0.98, 0.86, 0.66, 0.7, 0.31, 0.38, 0.93, 0.12, 0.68, 0.9, 0.08, 0.1, 0.24, 0.67, 0.42, 0.04, 0.8, 0.5, 0.03, 0.86, 0.7, 0.16, 0.32, 0.62, 0.34, 0.72, 0.98, 0.1, 0.21, 0.99, 0.96, 0.2, 0.09, 0.91, 0.89, 0.88, 0.2, 0.58, 0.94, 0.17, 0.41, 0.34, 0.73, 0.7, 0.3, 0.29, 0.37, 0.45, 0.85, 0.41, 0.43, 0.01, 0.72, 0.66, 0.06, 0.95, 0.7, 0.55, 0.56, 0.91, 0.14, 0.67, 0.33, 0.87, 0.93, 0.71, 0.64, 0.41, 0.68, 0.92, 0.77, 0.74, 0.96, 0.1, 0.86, 0.94, 0.98, 0.24, 0.5, 0.64, 0.26, 0.93, 0.69, 0.59, 0.32, 0.7, 0.53, 0.06, 0.92, 0.06, 0.41, 0.55, 0.67, 0.13, 0.09, 0.67, 0.23, 0.39, 0.57, 0.51, 0.16, 0.45, 0.65, 0.17, 0.83, 0.98, 0.74, 0.71, 0.28, 0.91, 0.14, 0.52, 0.07, 0.34, 0.09, 0.76, 0.45, 0.8, 0.52, 0.5, 0.23, 0.39, 0.59, 0.99, 0.29, 0.26, 0.85, 0.08, 0.63, 0.86, 0.93, 0.24, 0.53, 0.48, 0.27, 0.58, 0.5, 0.5, 0.19, 0.24, 0.47, 0.01, 0.98, 0.91, 0.59, 0.1, 0.11, 0.86, 0.71, 0.98, 0.12, 0.43, 0.22, 0.57, 0.84, 0.47, 0.76, 0.64, 0.39, 0.37, 0.03, 0.31, 0.77, 0.14, 0.2, 0.92, 0.16, 0.72, 0.1, 0.95, 0.63, 0.19, 0.46, 0.11, 0.15, 0.16, 0.36, 0.6, 0.39, 0.91, 0.85, 0.89, 0.17, 0.59, 0.66, 0.39, 0.78, 0.98, 0.43, 0.29, 0.42, 0.51, 0.58, 0.04, 0.74, 0.33, 0.21, 0.21, 0.28, 0.03, 0.22, 0.85, 0.83, 0.92, 0.55, 0.08, 0.71, 0.84, 0.61, 0.96, 0.65, 0.4, 0.95, 0.15, 0.67, 0.48, 0.16, 0.35, 0.23, 0.08, 0.19, 0.11, 0.49, 0.28, 0.87, 0.71, 0.04, 0.87, 0.24, 0.83, 0.13, 0.84, 0.69, 0.38, 0.65, 0.39, 0.18, 0.47, 0.24, 0.08, 0.43, 0.38, 0.44, 0.04, 0.74, 0.59, 0.2, 0.85, 0.35, 0.22, 0.14, 0.02, 0.67, 0.08, 0.08, 0.32, 0.35, 0.33, 0.13, 0.45, 0.12, 0.2, 0.68, 0.95, 0.96, 0.66, 0.07, 0.2, 0.85, 0.37, 0.97, 0.58, 0.34, 0.2, 0.96, 0.16, 0.19, 0.05, 0.06, 0.14, 0.71, 0.1, 0.39, 0.66, 0.42, 0.38, 0.86, 0.27, 0.61, 0.64, 0.29, 0.29, 0.94, 0.29, 0.37, 0.59, 0.87, 0.82, 0.61, 0.62, 0.13, 0.19, 0.81, 0.34, 0.07, 0.22, 0.32, 0.73, 0.76, 0.14, 0.74, 0.5, 0.9, 0.33, 0.09, 0.04, 0.85, 0.62, 0.41, 0.63, 0.96, 0.5, 0.13, 0.77, 0.93, 0.13, 0.96, 0.37, 0.52, 0.57, 0.1, 0.97, 0.74, 0.97, 0.05, 0.49, 0.39, 0.47, 0.62, 0.66, 0.69, 0.03, 0.45, 0.47, 0.64, 0.86, 0.95, 0.35, 0.22, 0.05, 0.13, 0.33, 0.87, 0.82, 0.17, 0.01, 0.78, 0.24, 0.12, 0.23, 0.34, 0.51, 0.71, 0.35, 0.19, 0.22, 0.68, 0.17, 0.23, 0.85, 0.13, 0.26, 0.32, 0.71, 0.56, 0.8, 0.59, 0.61, 0.31, 0.83, 0.28, 0.78, 0.35, 0.65, 0.54, 0.58, 0.86, 0.71, 0.26, 0.45, 0.86, 0.01, 0.05, 0.38, 0.46, 0.99, 0.75, 0.24, 0.63, 0.61, 0.45, 0.57, 0.66, 0.31, 0.94, 0.9, 0.57, 0.02, 0.82, 0.76, 0.33, 0.33, 0.33, 0.15, 0.24, 0.46, 0.74, 0.87, 0.96, 0.88, 0.94, 0.23, 0.69, 0.27, 0.55, 0.53, 0.97, 0.43, 0.35, 0.35, 0.3, 0.72, 0.34, 0.71, 0.14, 0.35, 0.69, 0.72, 0.78, 0.99, 0.71, 0.24, 0.87, 0.42, 0.92, 0.67, 0.79, 0.82, 0.63, 0.7, 0.59, 0.39, 0.13, 0.36, 0.93, 0.17, 0.78, 0.75, 0.14, 0.38, 0.94, 0.96, 0.23, 0.75, 0.75, 0.2, 0.06, 0.36, 0.08, 0.28, 0.84, 0.3, 0.24, 0.83, 0.36, 0.61, 0.89, 0.93, 0.84, 0.36, 0.1, 0.5, 0.7, 0.2, 0.87, 0.28, 0.78, 0.95, 0.09, 0.49, 0.1, 0.07, 0.55, 0.28, 0.49, 0.03, 0.31, 0.04, 0.76, 0.52, 0.29, 0.6, 0.29, 0.91, 0.42, 0.68, 0.76, 0.41, 0.29, 0.94, 0.08, 0.27, 0.11, 0.79, 0.42, 0.67, 0.73, 0.17, 0.04, 0.56, 0.52, 0.76, 0.9, 0.86, 0.55, 0.89, 0.32, 0.98, 0.13, 0.13, 0.55, 0.77, 0.47, 0.65, 0.37, 0.01, 0.11, 0.07, 0.32, 0.87, 0.77, 0.34, 0.66, 0.21, 0.86, 0.96, 0.76, 0.03, 0.19, 0.08, 0.51, 0.8, 0.04, 0.5, 0.07, 0.34, 0.65, 0.29, 0.09, 0.13, 0.15, 0.83, 0.26, 0.67, 0.99, 0.55, 0.66, 0.71, 0.94, 0.25, 0.67, 0.35, 0.18, 0.02, 0.42, 0.25, 0.88, 0.34, 0.22, 0.52, 0.65, 0.39, 0.37, 0.18, 0.97, 0.2, 0.32, 0.63, 0.03, 0.66, 0.04, 0.32, 0.96, 0.88, 0.4, 0.95, 0.81, 0.54, 0.69, 0.62, 0.9, 0.56, 0.15, 0.3, 0.1, 0.17, 0.96, 0.07, 0.62, 0.6, 0.28, 0.55, 0.93, 0.69, 0.02, 0.68, 0.72, 0.39, 0.13, 0.09, 0.69, 0.26, 0.39, 0.86, 0.47, 0.25, 0.66, 0.33, 0.01, 0.45, 0.75, 0.44, 0.07, 0.1, 0.65, 0.91, 0.7, 0.36, 0.18, 0.6, 0.18, 0.46, 0.05, 0.38, 0.86, 0.09, 0.5, 0.42, 0.12, 0.9, 0.64, 0.71, 0.37, 0.01, 0.03, 0.86, 0.98, 0.04, 0.57, 0.12, 0.28, 0.34, 0.23, 0.09, 0.24, 0.55, 0.16, 0.74, 0.81, 0.94, 0.25, 0.23, 0.86, 0.75, 0.09, 0.09, 0.99, 0.72, 0.15, 0.29, 0.13, 0.71, 0.72, 0.77, 0.1, 0.43, 0.47, 0.95, 0.33, 0.72, 0.61, 0.91, 0.1, 0.74, 0.09, 0.23, 0.74, 0.12, 0.44, 0.3, 0.27, 0.89, 0.41, 0.13, 0.98, 0.65, 0.37, 0.59, 0.77, 0.92, 0.1, 0.74, 0.39, 0.2, 0.7, 0.78, 0.6, 0.07, 0.86, 0.53, 0.43, 0.23, 0.73, 0.3, 0.62, 0.55, 0.14, 0.32, 0.07, 0.41, 0.29, 0.46, 0.41, 0.46, 0.61, 0.66, 0.45, 0.85, 0.82, 0.18, 0.82, 0.39, 0.83, 0.4, 0.65, 0.71, 0.19, 0.26, 0.62, 0.31, 0.15, 0.69, 0.5, 0.38, 0.31, 0.81, 0.56, 0.75, 0.48, 0.66, 0.35, 0.2, 0.05, 0.76, 0.12, 0.99, 0.12, 0.07, 0.24, 0.89, 0.35, 0.35, 0.29, 0.44, 0.72, 0.94, 0.98, 0.44, 0.96, 0.88, 0.95, 0.54, 0.94, 0.85, 0.25, 0.51, 0.51, 0.45, 0.46, 0.11, 0.14, 0.51, 0.39, 0.09, 0.36, 0.03, 0.55, 0.11, 0.32, 0.89, 0.72, 0.73, 0.49, 0.89, 0.52, 0.92, 0.74, 0.4, 0.57, 0.81, 0.38, 0.54, 0.33, 0.32, 0.76, 0.26, 0.63, 0.33, 0.36, 0.34, 0.73, 0.13, 0.29, 0.38, 0.49, 0.51, 0.03, 0.38, 0.13, 0.97, 0.01, 0.34, 0.43, 0.07, 0.47, 0.32, 0.98, 0.21, 0.55, 0.54, 0.29, 0.45, 0.79, 0.07, 0.37, 0.49, 0.19, 0.76, 0.69, 0.24, 0.43, 0.8, 0.5, 0.79, 0.02, 0.91, 0.19, 0.54, 0.63, 0.56, 0.63, 0.9, 0.03, 0.53, 0.69, 0.85, 0.78, 0.78, 0.65, 0.15, 0.74, 0.99, 0.06, 0.05, 0.34, 0.66, 0.49, 0.41, 0.05, 0.64, 0.65, 0.61, 0.49, 0.44, 0.36, 0.85, 0.52, 0.97, 0.96, 0.97, 0.93, 0.44, 0.97, 0.93, 0.27, 0.03, 0.83, 0.17, 0.23, 0.64, 0.25, 0.72, 0.13, 0.82, 0.6, 0.56, 0.73, 0.61, 0.72, 0.25, 0.67, 0.88, 0.17, 0.24, 0.96, 0.08, 0.14, 0.46, 0.11, 0.4, 0.89, 0.31, 0.82, 0.8, 0.25, 0.85, 0.87, 0.37, 0.25, 0.12, 0.26, 0.83, 0.57, 0.36, 0.97, 0.73, 0.04, 0.83, 0.21, 0.42, 0.01, 0.5, 0.74, 0.88, 0.25, 0.85, 0.03, 0.53, 0.28, 0.47, 0.41, 0.95, 0.82, 0.92, 0.79, 0.71, 0.85, 0.74, 0.64, 0.72, 0.27, 0.89, 0.89, 0.18, 0.79, 0.57, 0.92, 0.57, 0.09, 0.56, 0.58, 0.35, 0.26, 0.7, 0.68, 0.65, 0.77, 0.32, 0.59, 0.75, 0.94, 0.94, 0.83, 0.43, 0.22, 0.74, 0.47, 0.16, 0.26, 0.27, 0.47, 0.91, 0.62, 0.93, 0.46, 0.24, 0.19, 0.97, 0.07, 0.16, 0.34, 0.42, 0.43, 0.05, 0.68, 0.52, 0.84, 0.13, 0.47, 0.32, 0.85, 0.85, 0.52, 0.92, 0.88, 0.16, 0.07, 0.49, 0.28, 0.18, 0.91, 0.29, 0.7, 0.48, 0.68, 0.43, 0.91, 0.81, 0.26, 0.48, 0.75, 0.5, 0.64, 0.17, 0.82, 0.65, 0.9, 0.03, 0.13, 0.31, 0.97, 0.96, 0.21, 0.17, 0.82, 0.48, 0.77, 0.16, 0.24, 0.99, 0.37, 0.91, 0.68, 0.95, 0.93, 0.54, 0.72, 0.9, 0.26, 0.54, 0.51, 0.04, 0.73, 0.14, 0.95, 0.47, 0.99, 0.85, 0.22, 0.38, 0.56, 0.75, 0.18, 0.96, 0.17, 0.69, 0.51, 0.76, 0.89, 0.93, 0.88, 0.85, 0.57, 0.87, 0.54, 0.18, 0.69, 0.47, 0.32, 0.75, 0.82, 0.39, 0.16, 0.2, 0.54, 0.45, 0.16, 0.04, 0.68, 0.95, 0.89, 0.49, 0.01, 0.22, 0.18, 0.02, 0.93, 0.38, 0.46, 0.17, 0.86, 0.97, 0.06, 0.64, 0.57, 0.91, 0.17, 0.66, 0.69, 0.93, 0.44, 0.77, 0.03, 0.85, 0.35, 0.88, 0.39, 0.56, 0.56, 0.03, 0.14, 0.66, 0.32, 0.69, 0.05, 0.45, 0.91, 0.29, 0.77, 0.04, 0.8, 0.22, 0.71, 0.59, 0.52, 0.78, 0.41, 0.79, 0.5, 0.21, 0.68, 0.65, 0.63, 0.42, 0.27, 0.69, 0.4, 0.45, 0.27, 0.94, 0.87, 0.51, 0.01, 0.79, 0.15, 0.83, 0.08, 0.02, 0.84, 0.36, 0.97, 0.78, 0.46, 0.48, 0.56, 0.6, 0.38, 0.13, 0.99, 0.63, 0.85, 0.69, 0.37, 0.91, 0.34, 0.36, 0.55, 0.85, 0.77, 0.07, 0.73, 0.52, 0.79, 0.12, 0.97, 0.23, 0.03, 0.06, 0.97, 0.21, 0.15, 0.12, 0.65, 0.74, 0.14, 0.32, 0.23, 0.5, 0.65, 0.2, 0.94, 0.03, 0.97, 0.2, 0.58, 0.85, 0.61, 0.15, 0.57, 0.72, 0.99, 0.86, 0.13, 0.61, 0.02, 0.41, 0.64, 0.52, 0.35, 0.32, 0.77, 0.75, 0.38, 0.86, 0.83, 0.98, 0.96, 0.25, 0.99, 0.36, 0.42, 0.54, 0.41, 0.02, 0.59, 0.23, 0.79, 0.45, 0.96, 0.42, 0.64, 0.67, 0.28, 0.14, 0.7, 0.47, 0.97, 0.1, 0.97, 0.08, 0.75, 0.33, 0.51, 0.03, 0.47, 0.73, 0.46, 0.86, 0.79, 0.34, 0.12, 0.08, 0.49, 0.68, 0.43, 0.42, 0.54, 0.93, 0.84, 0.37, 0.23, 0.4, 0.97, 0.6, 0.73, 0.11, 0.96, 0.59, 0.07, 0.23, 0.75, 0.57, 0.3, 0.55, 0.67, 0.13, 0.76, 0.63, 0.77, 0.65, 0.1, 0.7, 0.84, 0.93, 0.02, 0.95, 0.96, 0.93, 0.4, 0.53, 0.58, 0.87, 0.49, 0.59, 0.56, 0.95, 0.11, 0.78, 0.86, 0.28, 0.71, 0.79, 0.53, 0.88, 0.86, 0.11, 0.33, 0.83, 0.2, 0.37, 0.41, 0.04, 0.85, 0.48, 0.81, 0.36, 0.86, 0.21, 0.92, 0.24, 0.62, 0.78, 0.68, 0.37, 0.22, 0.45, 0.62, 0.42, 0.23, 0.97, 0.89, 0.83, 0.89, 0.93, 0.51, 0.53, 0.05, 0.25, 0.54, 0.94, 0.35, 0.46, 0.36, 0.44, 0.06, 0.27, 0.23, 0.08, 0.03, 0.78, 0.26, 0.95, 0.54, 0.56, 0.29, 0.65, 0.92, 0.91, 0.54, 0.68, 0.3, 0.93, 0.84, 0.52, 0.75, 0.5, 0.87, 0.41, 0.91, 0.79, 0.42, 0.09, 0.61, 0.26, 0.17, 0.1, 0.15, 0.52, 0.86, 0.18, 0.63, 0.97, 0.88, 0.66, 0.69, 0.45, 0.21, 0.76, 0.78, 0.43, 0.31, 0.72, 0.84, 0.24, 0.92, 0.32, 0.51, 0.12, 0.44, 0.73, 0.72, 0.59, 0.74, 0.56, 0.13, 0.08, 0.28, 0.76, 0.66, 0.52, 0.21, 0.95, 0.66, 0.75, 0.82, 0.83, 0.39, 0.34, 0.05, 0.57, 0.12, 0.07, 0.11, 0.82, 0.46, 0.15, 0.25, 0.48, 0.66, 0.99, 0.13, 0.53, 0.04, 0.25, 0.07, 0.55, 0.11, 0.3, 0.13, 0.6, 0.41, 0.05, 0.12, 0.22, 0.1, 0.4, 0.2, 0.98, 0.4, 0.27, 0.64, 0.62, 0.51, 0.71, 0.75, 0.74, 0.99, 0.67, 0.53, 0.73, 0.1, 0.1, 0.35, 0.12, 0.67, 0.22, 0.74, 0.85, 0.45, 0.02, 0.02, 0.52, 0.14, 0.97, 0.07, 0.9, 0.35, 0.73, 0.53, 0.08, 0.82, 0.3, 0.12, 0.78, 0.07, 0.17, 0.46, 0.35, 0.15, 0.6, 0.06, 0.97, 0.39, 0.46, 0.75, 0.82, 0.83, 0.2, 0.98, 0.77, 0.6, 0.9, 0.76, 0.36, 0.16, 0.22, 0.08, 0.01, 0.12, 0.01, 0.01, 0.92, 0.53, 0.89, 0.36, 0.74, 0.61, 0.38, 0.9, 0.51, 0.29, 0.17, 0.83, 0.96, 0.99, 0.4, 0.06, 0.8, 0.65, 0.94, 0.5, 0.62, 0.7, 0.67, 0.19, 0.74, 0.13, 0.7, 0.54, 0.59, 0.47, 0.37, 0.8, 0.07, 0.53, 0.74, 0.3, 0.8, 0.92, 0.45, 0.07, 0.46, 0.98, 0.3, 0.4, 0.71, 0.11, 0.68, 0.27, 0.4, 0.06, 0.17, 0.36, 0.17, 0.96, 0.81, 0.74, 0.43, 0.95, 0.18, 0.31, 0.51, 0.78, 0.99, 0.54, 0.16, 0.27, 0.58, 0.65, 0.71, 0.58, 0.68, 0.57, 0.62, 0.43, 0.14, 0.25, 0.62, 0.49, 0.9, 0.69, 0.35, 0.13, 0.21, 0.36, 0.03, 0.26, 0.64, 0.45, 0.89, 0.08, 0.05, 0.78, 0.23, 0.12, 0.07, 0.95, 0.2, 0.54, 0.78, 0.13, 0.76, 0.15, 0.61, 0.11, 0.1, 0.33, 0.97, 0.88, 0.94, 0.43, 0.01, 0.05, 0.11, 0.13, 0.71, 0.2, 0.46, 0.07, 0.1, 0.69, 0.89, 0.52, 0.66, 0.89, 0.65, 0.22, 0.23, 0.68, 0.93, 0.24, 0.66, 0.86, 0.88, 0.14, 0.08, 0.26, 0.93, 0.1, 0.08, 0.94, 0.87, 0.67, 0.43, 0.79, 0.32, 0.79, 0.74, 0.19, 0.23, 0.99, 0.89, 0.88, 0.55, 0.11, 0.04, 0.99, 0.38, 0.44, 0.88, 0.51, 0.22, 0.9, 0.54, 0.81, 0.18, 0.45, 0.9, 0.83, 0.61, 0.12, 0.27, 0.71, 0.6, 0.43, 0.23, 0.7, 0.07, 0.99, 0.49, 0.58, 0.05, 0.14, 0.1, 0.92, 0.11, 0.49, 0.6, 0.35, 0.48, 0.79, 0.68, 0.07, 0.71, 0.25, 0.34, 0.61, 0.64, 0.48, 0.19, 0.74, 0.11, 0.61, 0.17, 0.85, 0.33, 0.88, 0.88, 0.96, 0.04, 0.78, 0.08, 0.75, 0.29, 0.37, 0.45, 0.48, 0.16, 0.16, 0.29, 0.83, 0.79, 0.56, 0.7, 0.01, 0.75, 0.88, 0.67, 0.1, 0.81, 0.77, 0.83, 0.5, 0.74, 0.21, 0.14, 0.14, 0.65, 0.02, 0.33, 0.12, 0.92, 0.02, 0.18, 0.15, 0.71, 0.1, 0.41, 0.12, 0.87, 0.91, 0.14, 0.56, 0.37, 0.13, 0.6, 0.83, 0.16, 0.18, 0.12, 0.64, 0.8, 0.66, 0.43, 0.66, 0.7, 0.45, 0.09, 0.08, 0.63, 0.89, 0.94, 0.83, 0.9, 0.41, 0.98, 0.99, 0.32, 0.91, 0.15, 0.86, 0.56, 0.94, 0.56, 0.28, 0.93, 0.54, 0.01, 0.69, 0.54, 0.94, 0.13, 0.3, 0.3, 0.86, 0.62, 0.42, 0.62, 0.05, 0.23, 0.15, 0.89, 0.08, 0.68, 0.11, 0.75, 0.28, 0.83, 0.69, 0.22, 0.81, 0.29, 0.16, 0.99, 0.1, 0.53, 0.61, 0.9, 0.76, 0.5, 0.81, 0.07, 0.48, 0.23, 0.87, 0.31, 0.11, 0.02, 0.34, 0.64, 0.04, 0.15, 0.18, 0.7, 0.81, 0.71, 0.99, 0.04, 0.13, 0.42, 0.32, 0.57, 0.58, 0.15, 0.85, 0.48, 0.19, 0.68, 0.63, 0.67, 0.35, 0.14, 0.48, 0.18, 0.21, 0.13, 0.7, 0.51, 0.04, 0.85, 0.32, 0.58, 0.26, 0.48, 0.14, 0.47, 0.56, 0.49, 0.17, 0.02, 0.98, 0.93, 0.46, 0.68, 0.24, 0.77, 0.26, 0.67, 0.25, 0.71, 0.28, 0.64, 0.67, 0.62, 0.98, 0.08, 0.02, 0.92, 0.03, 0.23, 0.54, 0.28, 0.08, 0.17, 0.64, 0.32, 0.78, 0.57, 0.24, 0.55, 0.33, 0.46, 0.72, 0.69, 0.35, 0.55, 0.56, 0.36, 0.62, 0.26, 0.25, 0.82, 0.1, 0.01, 0.19, 0.11, 0.74, 0.66, 0.73, 0.5, 0.92, 0.05, 0.51, 0.44, 0.42, 0.27, 0.37, 0.77, 0.87, 0.89, 0.64, 0.63, 0.36, 0.51, 0.88, 0.64, 0.37, 0.12, 0.39, 0.44, 0.46, 0.4, 0.88, 0.77, 0.77, 0.6, 0.3, 0.64, 0.05, 0.53, 0.57, 0.71, 0.36, 0.52, 0.03, 0.24, 0.82, 0.66, 0.25, 0.73, 0.19, 0.19, 0.64, 0.17, 0.05, 0.8, 0.75, 0.74, 0.31, 0.21, 0.94, 0.08, 0.5, 0.43, 0.86, 0.98, 0.64, 0.99, 0.42, 0.41, 0.05, 0.15, 0.1, 0.96, 0.89, 0.54, 0.15, 0.86, 0.6, 0.33, 0.97, 0.34, 0.17, 0.59, 0.22, 0.13, 0.17, 0.73, 0.25, 0.65, 0.38, 0.96, 0.34, 0.8, 0.84, 0.38, 0.55, 0.78, 0.36, 0.21, 0.69, 0.08, 0.29, 0.25, 0.21, 0.06, 0.87, 0.16, 0.27, 0.18, 0.5, 0.6, 0.24, 0.31, 0.7, 0.45, 0.72, 0.4, 0.16, 0.62, 0.81, 0.79, 0.53, 0.2, 0.87, 0.16, 0.05, 0.53, 0.95, 0.64, 0.32, 0.6, 0.87, 0.96, 0.64, 0.22, 0.44, 0.49, 0.55, 0.61, 0.49, 0.95, 0.45, 0.68, 0.51, 0.8, 0.1, 0.21, 0.82, 0.6, 0.2, 0.35, 0.19, 0.22, 0.02, 0.35, 0.07, 0.46, 0.28, 0.69, 0.29, 0.61, 0.47, 0.38, 0.97, 0.85, 0.61, 0.08, 0.76, 0.93, 0.71, 0.79, 0.07, 0.78, 0.91, 0.83, 0.87, 0.26, 0.76, 0.72]


tails = []

product = 1
for i in range(len(heads)):
    tails.append((1-heads[i]))
    product *= heads[i]


def solve(heads, tails, index, count, product, k):
    if index >= len(heads):
        return product
    elif count >= k:
        return product
    else:
        ans = 0
        ans += solve(heads, tails, index+1, count+1, ((product * tails[index])/heads[index]), k) + solve(heads, tails, index+1, count, product, k)
        return ans

print(solve(heads, tails, 0, 0, product, (n-1)//2))

Fixed submission:
n = int(input())

heads = list(map(float, input().split()))

dp = []

for i in range(n+1):
    temp = []
    for j in range(n+1):
        temp.append(0.0)
    
    dp.append(temp)

dp[0][0] = 1.0

for i in range(1, n+1):
    for j in range(0, n+1):
        dp[i][j] = dp[i-1][j] * (1-heads[i-1]) + dp[i-1][j-1] * heads[i-1]


ans = 0
for i in range((n+1)//2, n+1):
    ans += dp[n][i]

print(ans)