import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;

public class PopDen01{
    public static void main(String[] args){
        String filename = "countryData.txt";

        // Try to open data file
        File fileObject = new File(filename);
        Scanner fileScanner = null;
        try{
            fileScanner = new Scanner(fileObject);
        }catch(FileNotFoundException e){
            System.err.println(e.toString());
            System.exit(1);
        }

        // Ignore first line (get the read position marker to past the first line)
        if( fileScanner.hasNextLine() ){
            String header = fileScanner.nextLine(); // skip
            // System.err.println("DEBUGGING: header: " + header);
        }else{
            System.err.println("Expecting a header, but didn't find one");
        }
        // For each subsequent line
        //     Read in county name, population and area
        while( fileScanner.hasNext() == true ){
            // Afghanistan	38041754	652860
            String countryId = fileScanner.next();
            double population = fileScanner.nextDouble();
            double area = fileScanner.nextDouble();
            // System.err.println("countryId: " + countryId);
            // System.err.println("population: " + population);
            // System.err.println("area: " + area);

            //     Display population density (population / area), rounded to 1 decimal place
            System.out.println( countryId + "\t"+ Math.round((population / area)*10.0)/10.0 );
        }
    }
}