# 
# Hi,
# 
# This is my solution.
# It's pretty simple and straightforward.
# 
# George P.

#! /opt/bin/perl5 -w
use strict;

my (@arr) = (100,100,100);
print STDERR "RES(" . join("|", &fudge_numbers(0, @arr)) . ")\n";

sub fudge_numbers
	{
	my ($dec, @data, @percent, $sum, $persum);
	($dec, @data) = @_;
	map {$sum += $_} @data;
	@percent = map { sprintf("%0.${dec}f", ($_ / $sum * 100)) } @data;
	map {$persum += $_} @percent;
	$percent[$#percent] += (100 - $persum);
	return @percent;
	}



