#!/bin/csh -f

set maxpar = $1 # maximum no. of participations; if 0, report true max.
set maxscore = $2 # maximum score


if ($maxpar == 0) then
  sort -n | tail -n 1
else
  awk '{print '$maxscore'*exp(log($1/'$maxpar'+.00000001)/3), $0}' | tac
endif
