//argv vector version, in macro form
#include "Util/void.h"
#define rollarg(argv) ({double r=rdouble();char* res="";\
for(size_t i=1; argv[i]/*stop on nullarg*/;i++){r-=atof(argv[i]);\
if(r<0.0){res=tmax(strrchr(argv[i],',')+1,argv[i])/*protect from invalid arg format*/;break;}};\
res;})
int main(int argc,char**argv){
puts(rollarg(argv));
// ./chal 0.5,"50% chance" 0.2,"20% chance" 1.0,"30% chance"
;}