#include "testlib.h"

using namespace std;

int main(int argc, char* argv[]) {
    registerScorer(argc, argv, [](std::vector<TestResult> trs) {
        map<string, double> res;

        for (auto& i : trs) {
          if (i.verdict != OK) {
            res[i.group] = 0;
          } else {
            if (res.count(i.group)) {
              res[i.group] = min(res[i.group], i.points);
            } else {
              res[i.group] = i.points;
            }
          }
        }

        double score = 0;

        for (auto i : res) {
          score += i.second;
        }

        return score;
    });
}
