Language: C++

#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int N;
double p,a,b,c,d,e,f,s,m,ef;
string l;

int main(){
	while(cin>>N){
		if(!N)return 0;
		pair<double,string> pa[50];
		for(int i=0;i<N;i++){
			cin>>l>>p>>a>>b>>c>>d>>e>>f>>s>>m;
			ef=-1*((f*s*m)-p)/(a+b+c+(d+e)*m);
			pa[i]=make_pair(ef,l);
		}
		sort(pa,pa+N);
		for(int i=0;i<N;i++)cout<<pa[i].second<<endl;
		cout<<"#"<<endl;
	}
}
#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

int N;
double p,a,b,c,d,e,f,s,m,ef;
string l;

int main(){
	while(cin>>N){
		if(!N)return 0;
		pair<double,string> pa[50];
		for(int i=0;i<N;i++){
			cin>>l>>p>>a>>b>>c>>d>>e>>f>>s>>m;
			ef=-1*((f*s*m)-p)/(a+b+c+(d+e)*m);
			pa[i]=make_pair(ef,l);
		}
		sort(pa,pa+N);
		for(int i=0;i<N;i++)cout<<pa[i].second<<endl;
		cout<<"#"<<endl;
	}
}

Compiler output:
a.cc:49:5: error: redefinition of 'int N'
   49 | int N;
      |     ^
a.cc:16:5: note: 'int N' previously declared here
   16 | int N;
      |     ^
a.cc:50:8: error: redefinition of 'double p'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |        ^
a.cc:17:8: note: 'double p' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |        ^
a.cc:50:10: error: redefinition of 'double a'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |          ^
a.cc:17:10: note: 'double a' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |          ^
a.cc:50:12: error: redefinition of 'double b'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |            ^
a.cc:17:12: note: 'double b' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |            ^
a.cc:50:14: error: redefinition of 'double c'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |              ^
a.cc:17:14: note: 'double c' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |              ^
a.cc:50:16: error: redefinition of 'double d'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |                ^
a.cc:17:16: note: 'double d' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |                ^
a.cc:50:18: error: redefinition of 'double e'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |                  ^
a.cc:17:18: note: 'double e' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |                  ^
a.cc:50:20: error: redefinition of 'double f'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |                    ^
a.cc:17:20: note: 'double f' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |                    ^
a.cc:50:22: error: redefinition of 'double s'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |                      ^
a.cc:17:22: note: 'double s' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |                      ^
a.cc:50:24: error: redefinition of 'double m'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |                        ^
a.cc:17:24: note: 'double m' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |                        ^
a.cc:50:26: error: redefinition of 'double ef'
   50 | double p,a,b,c,d,e,f,s,m,ef;
      |                          ^~
a.cc:17:26: note: 'double ef' previously declared here
   17 | double p,a,b,c,d,e,f,s,m,ef;
      |                          ^~
a.cc:51:8: error: redefinition of 'std::string l'
   51 | string l;
      |        ^
a.cc:18:8: note: 'std::string l' previously declared here
   18 | string l;
      |        ^
a.cc:53:5: error: redefinition of 'int main()'
   53 | int main(){
      |     ^~~~
a.cc:20:5: note: 'int main()' previously defined here
   20 | int main(){
      |     ^~~~