package com.menzus.gcj._2012.qualification.b;

import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;

public class BProcessorFactory extends AbstractProcessorFactory<BInput, BOutputEntry> {
    public BProcessorFactory(String inputFileName) {
	super(inputFileName);
    }

    @Override
    protected InputBlockParser<BInput> createInputBlockParser() {
	return new BInputBlockParser();
    }

    @Override
    protected OutputProducer<BInput, BOutputEntry> createOutputProducer() {
	return new BOutputProducer();
    }
}

package br.com.atama.google.jam.dancing;

public class ScoreCalculator {

	private final Show show;

	public ScoreCalculator(int numSurprises, int scoreThreshold,
			int[] totalScores) {
		Context.INSTANCE.setNumSurprises(numSurprises);
		Context.INSTANCE.setThreshold(scoreThreshold);

		show = new Show(totalScores);
	}

	public int calculate() {
		show.addSurprises(Context.INSTANCE.getNumSurprises());

		return show.getTotalGoodScores();
	}

}
