Language: Java

'use strict'

function main(input){
  const lines = input.split('\n');
  const ABCDEF = lines.shift().split(' ').map(x => parseInt(x));
  const A = ABCDEF[0];
  const B = ABCDEF[1];

  const C = ABCDEF[2];
  const D = ABCDEF[3];

  const E = ABCDEF[4];
  const F = ABCDEF[5];

  let water = [];
  let sugers = [];
  for(let i=0;i<=F;i++){
    for(let j=0;j<=F;j++){
      let current_water = 100*(A*i+B*j);
      if(current_water<=F){ water.push(current_water); }

      let current_suger = C*i + D*j;
      if(current_suger<=F){ sugers.push(current_suger); }
    }
  }

  let results = [];
  let limit_density = 100*E/(100+E);

  for(let i=0;i<water.length;i++){
    for(let j=0;j<sugers.length;j++){
      let total_gram = water[i] + sugers[j];
      let current_density = 100*sugers[j]/water[i];
      if( (total_gram <= F) && (current_density <= E) ){
        results.push([water[i], sugers[j]]);
      }
    }
  }

  let tmp_density = 0;
  let result = [];
  for(let i=0;i<results.length;i++){
      let current_density = 100*results[i][1]/(results[i][0]+results[i][1]);
      if(current_density > tmp_density){ 
        tmp_density = current_density;
        result = [results[i][0], results[i][1]]
      }
  }

//console.log(result);
  console.log((result[0] + result[1])+' '+result[1]);
}
main( require('fs').readFileSync( '/dev/stdin', 'utf8') );


Compiler output:
Main.java:1: error: unclosed character literal
'use strict'
^
Main.java:1: error: illegal line end in character literal
'use strict'
           ^
Main.java:5: error: class, interface, enum, or record expected
  const ABCDEF = lines.shift().split(' ').map(x => parseInt(x));
  ^
Main.java:6: error: class, interface, enum, or record expected
  const A = ABCDEF[0];
  ^
Main.java:7: error: class, interface, enum, or record expected
  const B = ABCDEF[1];
  ^
Main.java:9: error: class, interface, enum, or record expected
  const C = ABCDEF[2];
  ^
Main.java:10: error: class, interface, enum, or record expected
  const D = ABCDEF[3];
  ^
Main.java:12: error: class, interface, enum, or record expected
  const E = ABCDEF[4];
  ^
Main.java:13: error: class, interface, enum, or record expected
  const F = ABCDEF[5];
  ^
Main.java:15: error: unnamed classes are a preview feature and are disabled by default.
  let water = [];
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:15: error: illegal start of expression
  let water = [];
              ^
Main.java:16: error: illegal start of expression
  let sugers = [];
               ^
Main.java:17: error: class, interface, enum, or record expected
  for(let i=0;i<=F;i++){
  ^
Main.java:17: error: class, interface, enum, or record expected
  for(let i=0;i<=F;i++){
              ^
Main.java:17: error: class, interface, enum, or record expected
  for(let i=0;i<=F;i++){
                   ^
Main.java:18: error: class, interface, enum, or record expected
    for(let j=0;j<=F;j++){
                ^
Main.java:18: error: class, interface, enum, or record expected
    for(let j=0;j<=F;j++){
                     ^
Main.java:20: error: class, interface, enum, or record expected
      if(current_water<=F){ water.push(current_water); }
      ^
Main.java:20: error: class, interface, enum, or record expected
      if(current_water<=F){ water.push(current_water); }
                                                       ^
Main.java:23: error: class, interface, enum, or record expected
      if(current_suger<=F){ sugers.push(current_suger); }
      ^
Main.java:23: error: class, interface, enum, or record expected
      if(current_suger<=F){ sugers.push(current_suger); }
                                                        ^
Main.java:30: error: class, interface, enum, or record expected
  for(let i=0;i<water.length;i++){
  ^
Main.java:30: error: class, interface, enum, or record expected
  for(let i=0;i<water.length;i++){
              ^
Main.java:30: error: class, interface, enum, or record expected
  for(let i=0;i<water.length;i++){
                             ^
Main.java:31: error: class, interface, enum, or record expected
    for(let j=0;j<sugers.length;j++){
                ^
Main.java:31: error: class, interface, enum, or record expected
    for(let j=0;j<sugers.length;j++){
                                ^
Main.java:34: error: class, interface, enum, or record expected
      if( (total_gram <= F) && (current_density <= E) ){
      ^
Main.java:36: error: class, interface, enum, or record expected
      }
      ^
Main.java:41: error: illegal start of expression
  let result = [];
               ^
Main.java:42: error: class, interface, enum, or record expected
  for(let i=0;i<results.length;i++){
  ^
Main.java:42: error: class, interface, enum, or record expected
  for(let i=0;i<results.length;i++){
              ^
Main.java:42: error: class, interface, enum, or record expected
  for(let i=0;i<results.length;i++){
                               ^
Main.java:44: error: class, interface, enum, or record expected
      if(current_density > tmp_density){ 
      ^
Main.java:46: error: class, interface, enum, or record expected
        result = [results[i][0], results[i][1]]
        ^
Main.java:52: error: class, interface, enum, or record expected
}
^
Main.java:53: error: unclosed character literal
main( require('fs').readFileSync( '/dev/stdin', 'utf8') );
              ^
Main.java:53: error: unclosed character literal
main( require('fs').readFileSync( '/dev/stdin', 'utf8') );
                 ^
Main.java:53: error: unclosed character literal
main( require('fs').readFileSync( '/dev/stdin', 'utf8') );
                                  ^
Main.java:53: error: unclosed character literal
main( require('fs').readFileSync( '/dev/stdin', 'utf8') );
                                             ^
Main.java:53: error: unclosed character literal
main( require('fs').readFileSync( '/dev/stdin', 'utf8') );
                                                ^
Main.java:53: error: unclosed character literal
main( require('fs').readFileSync( '/dev/stdin', 'utf8') );
                                                     ^
41 errors