<span style="font-size:14px;">#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
using namespace std;
int dir_x[]={1,-1,0};
int dir_y[]={-1,0,1};
typedef struct v_line{
long long x,y;
};
long long cross(v_line a,v_line b){
return a.x*b.y-b.x*a.y;
}
int main()
{
int t;
string str;
cin>>t;
while(t--){
cin>>str;
v_line temp,p;
temp.x=0;temp.y=0;
long long ans=0;
int len=str.size()-1;
for(int i=0;i<len;i++){
p.x=dir_x[(str[i]-'0')%3];
p.y=dir_y[(str[i]-'0'-1)/3];
ans+=cross(temp,p);
temp.x+=p.x;
temp.y+=p.y;
}
if(ans<0) ans=-ans;
if(ans%2==0)
printf("%lld\n",ans/2);
else
printf("%lld.5\n",ans/2);
}
}</span>