var Main = function(input){ var element = input.split("\n"); var maxWidth = parseInt(element[0], 10); var length = parseInt(element[1], 10); console.log(element[2]); nums.sort(); var tasizan = 0; for(i =0;i < length; i++){ tasizan += nums[i]; if(tasizan > maxWidth){ break; } } console.log(i); }; //Don't Edit this code Main(require("fs").readFileSync("/dev/stdin", "utf8"));