<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
I have an example data as:
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame({'datetime': ['2021-04-10 01:00:00', '2021-04-10 02:00:00', '2021-04-10 03:00:00', '2021-04-10 04:00:00', '2021-04-10 05:00:00'],
                   'col1': [25, 25, 25, 50, 100],
                   'col2': [50, 50, 100, 50, 100],
                   'col3': [50, 50, 50, 100, 100]})
df['datetime'] = pd.to_datetime(df['datetime'])
import numpy as np
def g(df):
    df['state'] = np.where((df['col2'] > 50) & (df['col3'] > 50), df['col1'], df[['col1', 'col2', 'col3']].sum(axis=1))
    return df
df = g(df.copy())
<END_TASK>