Cod sursa(job #1057146)

Utilizator marin.cristianCristian Marin marin.cristian Data 14 decembrie 2013 14:23:51
Problema Progresie Scor 0
Compilator cpp Status done
Runda ONIS 2014, Runda 1 Marime 0.28 kb
#include<fstream>
using namespace std;

int T;
unsigned long long nr,N,R;

int main(){
	
	ifstream f("progresie.in");
	ofstream g("progresie.out");
	
	f>>T;
	
	while(T){
		
		f>>N>>R;
		nr = ((N-1)*R)*((N-1)*R+1)+1;
		g<<nr<<'\n';
		--T;
	}
	
	
	return 0;
}