while {[scan [gets stdin] %d%d x y]>0} { set a 0 while {~$x&&~$y} { incr a [expr {$x*$y}] incr x -1 incr y -1 } puts $a }