#include <stdio.h>
int poligono(int n, int v){
int vs;
if(n>0){
n--;
vs = v;
}
else if (n<0){
n++;
vs = -v;
}
if(n==0)
return vs;
else
return vs + poligono(n,v);
}
int main(){
int n,v,res=0;
res=poligono(n,v);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgcG9saWdvbm8oaW50IG4sIGludCB2KXsKCWludCB2czsKICAgIGlmKG4+MCl7CiAgICAJbi0tOwogICAgCXZzID0gdjsKICAgIH0KICAgIGVsc2UgaWYgKG48MCl7CiAgICAJbisrOwogICAgCXZzID0gLXY7CiAgICB9CgogICAgaWYobj09MCkKICAgICAgICByZXR1cm4gdnM7CiAgICBlbHNlCiAgICAgICAgcmV0dXJuIHZzICsgcG9saWdvbm8obix2KTsKfQoKaW50IG1haW4oKXsKCiAgICBpbnQgbix2LHJlcz0wOwogICAgc2NhbmYoIiVkJWQiLCZuLCZ2KTsKICAgIHJlcz1wb2xpZ29ubyhuLHYpOwogICAgcHJpbnRmKCJSZXMgPSAlZFxuIixyZXMpOwoKICAgIHJldHVybiAwOwoKfQ==