// Arup Guha
// 3/8/2016
// Solution to 2015 MCPC Problem B: Agglomerator

import java.util.*;

public class agglomerator {

	public static ArrayList<circle> list;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		list = new ArrayList<circle>();

		// Read in the circles.
		for (int i=0; i<n; i++) {
			double x = stdin.nextDouble();
			double y = stdin.nextDouble();
			double dx = stdin.nextDouble();
			double dy = stdin.nextDouble();
			double r = stdin.nextDouble();
			list.add(new circle(x,y,dx,dy,r));
		}

		double last = 0;
		while (true) {

			// Find who intersects next.
			int[] pair = new int[2];
			double nextT = getNextIntersect(pair);

			// No intersection was found.
			if (nextT < 0) break;

			// Update our state - last time of intersection and locations of all circles.
			last += nextT;
			for (circle c: list)
				c.updatePos(nextT);

			// Calculate the new circle.
			circle bigger = list.get(pair[0]).combine(list.get(pair[1]));

			// Remove the two circles that intersected.
			list.remove(Math.max(pair[0], pair[1]));
			list.remove(Math.min(pair[0], pair[1]));

			// Add this circle.
			list.add(bigger);
		}

		// Report result.
		System.out.println(list.size()+" "+last);
	}

	public static double getNextIntersect(int[] pair) {

		double best = -1;

		// Try all pairs.
		for (int i=0; i<list.size(); i++) {
			for (int j=i+1; j<list.size(); j++) {

				// Get the time.
				double t = list.get(i).intersect(list.get(j));
				if (t < 0) continue;

				// Update if this one's better.
				if (best < 0 || t < best) {
					best = t;
					pair[0] = i;
					pair[1] = j;
				}
			}
		}

		return best;
	}
}

class circle {

	public double x;
	public double y;
	public double dx;
	public double dy;
	public double r;

	public circle(double myx, double myy, double mydx, double mydy, double myr) {
		x = myx;
		y = myy;
		dx = mydx;
		dy = mydy;
		r = myr;
	}

	// Updates the position to be dt time units later.
	public void updatePos(double dt) {
		x = x + dx*dt;
		y = y + dy*dt;
	}

	// Pre-requisite: Can only be called if this and other are touching.
	public circle combine(circle other) {

		// Useful for calculations.
		double numThis = this.r*this.r;
		double numOther = other.r*other.r;
		double den = numThis + numOther;

		// Just figure out each proportion and create the new object.
		double newx = numThis/den*x + numOther/den*other.x;
		double newy = numThis/den*y + numOther/den*other.y;
		double newdx = numThis/den*dx + numOther/den*other.dx;
		double newdy = numThis/den*dy + numOther/den*other.dy;
		double newr = Math.sqrt(den);
		return new circle(newx, newy, newdx, newdy, newr);
	}

	public double intersect(circle other) {

		// Just to simplify setting up the quadratic - parametric equation setting distance between circles to r + other.r.
		double c1 = dx - other.dx;
		double c2 = x - other.x;
		double d1 = dy - other.dy;
		double d2 = y - other.y;

		// a, b and c for our quadratic in t, the time of intersection of these two, assuming the current positions are for t = 0.
		double a = c1*c1 + d1*d1;
		double b = 2*c1*c2 + 2*d1*d2;
		double c = c2*c2 + d2*d2 - (r+other.r)*(r+other.r);

		// Negative number indicates no solution as does no a coefficient.
		double disc = b*b - 4*a*c;
		if (disc < -1e-9) return -1;
		if (Math.abs(a) <1e-9) return -1;

		// We want the positive solution to the quadratic. (Equations of this form never have 2 positive solutions...)

		double r1 = (-b - Math.sqrt(disc))/(2*a);
		double r2 = (-b + Math.sqrt(disc))/(2*a);

		// Both happened in the past.
		if (r1 < -1e-9 && r2 < -1e-9) return -1;

		// One is in the past, so the second one is the one we care about.
		if (r1 < -1e-9) return r2;

		// If both are in the future, the first contact is what's relevant.
		return r1;
	}
}